Search Results

Search found 30 results on 2 pages for 'programmerist'.

Page 1/2 | 1 2  | Next Page >

  • IF adding new Entity gives error me : EntityCommandCompilationException was unhandled bu user code

    - by programmerist
    i have 5 tables in started projects. if i adds new table (Urun enttiy) writing below codes: project.BAL : public static List<Urun> GetUrun() { using (GenoTipSatisEntities genSatisUrunCtx = new GenoTipSatisEntities()) { ObjectQuery<Urun> urun = genSatisUrunCtx.Urun; return urun.ToList(); } } if i receive data form BAL in UI.aspx: using project.BAL; namespace GenoTip.Web.ContentPages.Satis { public partial class SatisUrun : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { FillUrun(); } } void FillUrun() { ddlUrun.DataSource = SatisServices.GetUrun(); ddlUrun.DataValueField = "ID"; ddlUrun.DataTextField = "Ad"; ddlUrun.DataBind(); } } } i added URun later. error appears ToList method: EntityCommandCompilationException was unhandled bu user code error Detail: Error 1 Error 3007: Problem in Mapping Fragments starting at lines 659, 873: Non-Primary-Key column(s) [UrunID] are being mapped in both fragments to different conceptual side properties - data inconsistency is possible because the corresponding conceptual side properties can be independently modified. C:\Users\pc\Desktop\GenoTip.Satis\GenoTip.DAL\ModelSatis.edmx 660 15 GenoTip.DAL Error 2 Error 3012: Problem in Mapping Fragments starting at lines 659, 873: Data loss is possible in FaturaDetay.UrunID. An Entity with Key (PK) will not round-trip when: (PK does NOT play Role 'FaturaDetay' in AssociationSet 'FK_FaturaDetay_Urun' AND PK is in 'FaturaDetay' EntitySet) C:\Users\pc\Desktop\GenoTip.Satis\GenoTip.DAL\ModelSatis.edmx 874 11 GenoTip.DAL Error 3 Error 3012: Problem in Mapping Fragments starting at lines 659, 873: Data loss is possible in FaturaDetay.UrunID. An Entity with Key (PK) will not round-trip when: (PK is in 'FaturaDetay' EntitySet AND PK does NOT play Role 'FaturaDetay' in AssociationSet 'FK_FaturaDetay_Urun' AND Entity.UrunID is not NULL) C:\Users\pc\Desktop\GenoTip.Satis\GenoTip.DAL\ModelSatis.edmx 660 15 GenoTip.DAL Error 4 Error 3007: Problem in Mapping Fragments starting at lines 748, 879: Non-Primary-Key column(s) [UrunID] are being mapped in both fragments to different conceptual side properties - data inconsistency is possible because the corresponding conceptual side properties can be independently modified. C:\Users\pc\Desktop\GenoTip.Satis\GenoTip.DAL\ModelSatis.edmx 749 15 GenoTip.DAL Error 5 Error 3012: Problem in Mapping Fragments starting at lines 748, 879: Data loss is possible in Satis.UrunID. An Entity with Key (PK) will not round-trip when: (PK does NOT play Role 'Satis' in AssociationSet 'FK_Satis_Urun' AND PK is in 'Satis' EntitySet) C:\Users\pc\Desktop\GenoTip.Satis\GenoTip.DAL\ModelSatis.edmx 880 11 GenoTip.DAL Error 6 Error 3012: Problem in Mapping Fragments starting at lines 748, 879: Data loss is possible in Satis.UrunID. An Entity with Key (PK) will not round-trip when: (PK is in 'Satis' EntitySet AND PK does NOT play Role 'Satis' in AssociationSet 'FK_Satis_Urun' AND Entity.UrunID is not NULL) C:\Users\pc\Desktop\GenoTip.Satis\GenoTip.DAL\ModelSatis.edmx 749 15 GenoTip.DAL

    Read the article

  • How to solve out of memory exception error in Entity FramWork?

    - by programmerist
    Hello; these below codes give whole data of my Rehber datas. But if i want to show web page via Gridview send me out of memory exception error. GenoTip.BAL: public static List<Rehber> GetAllDataOfRehber() { using (GenoTipSatisEntities genSatisCtx = new GenoTipSatisEntities()) { ObjectQuery<Rehber> rehber = genSatisCtx.Rehber; return rehber.ToList(); } } if i bind data directly dummy gridview like that no problem occures every thing is great!!! <asp:GridView ID="gwRehber" runat="server"> </asp:GridView> if above codes send data to Satis.aspx page: using GenoTip.BAL; namespace GenoTip.Web.ContentPages.Satis { public partial class Satis : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { gwRehber.DataSource = SatisServices.GetAllDataOfRehber(); gwRehber.DataBind(); //gwRehber.Columns[0].Visible = false; } } } } but i rearranged my gridview send me out of memory exception!!!! i need this arrangenment to show deta!!! <asp:GridView ID="gwRehber" runat="server"> <Columns> <%-- <asp:TemplateField> <ItemTemplate> <asp:Button runat="server" ID="btnID" CommandName="select" CommandArgument='<%# Eval("ID") %>' Text="Seç" /> </ItemTemplate> </asp:TemplateField>--%> <asp:BoundField DataField="Ad" HeaderText="Ad" /> <asp:BoundField DataField="BireyID" HeaderText="BireyID" Visible="false" /> <asp:BoundField DataField="Degistiren" HeaderText="Degistiren" /> <asp:BoundField DataField="EklemeTarihi" HeaderText="EklemeTarihi" /> <asp:BoundField DataField="DegistirmeTarihi" HeaderText="Degistirme Tarihi" Visible="false" /> <asp:BoundField DataField="Ekleyen" HeaderText="Ekleyen" /> <asp:BoundField DataField="ID" HeaderText="ID" Visible="false" /> <asp:BoundField DataField="Imza" HeaderText="Imza" /> <asp:BoundField DataField="KurumID" HeaderText="KurumID" Visible="false" /> </Columns> </asp:GridView> Error Detail : [OutOfMemoryException: 'System.OutOfMemoryException' türünde özel durum olusturuldu.] System.String.GetStringForStringBuilder(String value, Int32 startIndex, Int32 length, Int32 capacity) +29 System.Convert.ToBase64String(Byte[] inArray, Int32 offset, Int32 length, Base64FormattingOptions options) +146 System.Web.UI.ObjectStateFormatter.Serialize(Object stateGraph) +183 System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Serialize(Object state) +4 System.Web.UI.Util.SerializeWithAssert(IStateFormatter formatter, Object stateGraph) +37 System.Web.UI.HiddenFieldPageStatePersister.Save() +79 System.Web.UI.Page.SavePageStateToPersistenceMedium(Object state) +105 System.Web.UI.Page.SaveAllState() +236 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1099

    Read the article

  • How to use MBSA in C#?

    - by programmerist
    i try to use some vulnarability scanner on my network(computer, server,switch etc.). i think a scanner like MBSA return some data how to get these data and how to show some datatables to user in C#. I want to make a plugin or web or win App via C#?

    Read the article

  • How can i navigate one xaml page to another?

    - by programmerist
    i have 2 page i need to navigate mainpage.xaml to login.page xaml but it throws me Object reference not set to an instance of an object. in Root.Children.Clear();.... i added this codes in App.xaml: private void Application_Startup(object sender, StartupEventArgs e) { Grid myGrid = new Grid(); myGrid.Children.Add(new MainPage()); this.RootVisual = myGrid; } and than i adde some codes on main.xaml to navigate to LoginUI.xaml namespace Gen.CallCenter.UI { public partial class MainPage : UserControl { public MainPage() { InitializeComponent(); Grid Root = ((Grid)(this.Parent)); Root.Children.Clear(); Root.Children.Add(new LoginUI()); } } } How can i navigate main.xaml to LoginUI.xaml ?

    Read the article

  • i don't solve "must declare a body because it is not marked abstract, extern, or partial" problem?

    - by programmerist
    How can i solve "must declare a body because it is not marked abstract, extern, or partial". This problem. Can you show me some advices? Full Error message is about Save, Update, Delete, Select events... Full message sample : GenoTip.DAL._AccessorForSQL.Save(string, System.Collections.Specialized.ListDictionary, System.Data.CommandType)' must declare a body because it is not marked abstract, extern, or partial This error also return in Update, Delete, Select... public abstract class _AccessorForSQL { public virtual bool Save(string sp, ListDictionary ld, CommandType cmdType); public virtual bool Update(); public virtual bool Delete(); public virtual DataSet Select(); } class GenAccessor : _AccessorForSQL { DataSet ds; DataTable dt; public override bool Save(string sp, ListDictionary ld, CommandType cmdType) { SqlConnection con = null; SqlCommand cmd = null; SqlDataReader dr = null; try { con = GetConnection(); cmd = new SqlCommand(sp, con); con.Open(); cmd.CommandType = cmdType; foreach (string ky in ld.Keys) { cmd.Parameters.AddWithValue(ky, ld[ky]); } dr = cmd.ExecuteReader(); ds = new DataSet(); dt = new DataTable(); ds.Tables.Add(dt); ds.Load(dr, LoadOption.OverwriteChanges, dt); } catch (Exception exp) { HttpContext.Current.Trace.Warn("Error in GetCustomerByID()", exp.Message, exp); } finally { if (dr != null) dr.Close(); if (con != null) con.Close(); } return (ds.Tables[0].Rows.Count 0) ? true : false; } public override bool Update() { return true; } public override bool Delete() { return true; } public override DataSet Select() { DataSet dst = new DataSet(); return dst; } private static SqlConnection GetConnection() { string connStr = WebConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString; SqlConnection conn = new SqlConnection(connStr); return conn; }

    Read the article

  • Static method , Abstract method , Interface method comparision ?

    - by programmerist
    When i choose these methods? i can not decide which one i must prefer or when will i use one of them?which one give best performance? First Type Usage public abstract class _AccessorForSQL { public virtual bool Save(string sp, ListDictionary ld, CommandType cmdType); public virtual bool Update(); public virtual bool Delete(); public virtual DataSet Select(); } class GenAccessor : _AccessorForSQL { DataSet ds; DataTable dt; public override bool Save(string sp, ListDictionary ld, CommandType cmdType) { } public override bool Update() { return true; } public override bool Delete() { return true; } public override DataSet Select() { DataSet dst = new DataSet(); return dst; } Second Type Usage Also i can write it below codes: public class GenAccessor { public Static bool Save() { } public Static bool Update() { } public Static bool Delete() { } } Third Type Usage Also i can write it below codes: public interface IAccessorForSQL { bool Delete(); bool Save(string sp, ListDictionary ld, CommandType cmdType); DataSet Select(); bool Update(); } public class _AccessorForSQL : IAccessorForSQL { private DataSet ds; private DataTable dt; public virtual bool Save(string sp, ListDictionary ld, CommandType cmdType) { } } } I can use first one below usage: GenAccessor gen = New GenAccessor(); gen.Save(); I can use second one below usage: GenAccessor.Save(); Which one do you prefer? When will i use them? which time i need override method ? which time i need static method?

    Read the article

  • How to use Subsonic 2.0 ?

    - by programmerist
    i try to use subsonic 3.0 but i can not do that. i decided to use subsonic.2.0. So i try to make it i can not :( my Web Config : <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name="SubSonicService" type="SubSonic.SubSonicSection, SubSonic" requirePermission="false"/> </configSections> <connectionStrings> <add name="AdventureWorks" connectionString="Data Source=.;Database=eticaret; Integrated Security=true; User ID=sa; Password=123456;"/> </connectionStrings> <SubSonicService defaultProvider="eticaret"> <providers> <clear/> <add name="eticaret" type="SubSonic.SqlDataProvider, SubSonic" connectionStringName="eticaret" generatedNamespace="eticaretDAL"/> </providers> </SubSonicService> </configuration> also look this article: what is error? http://www.codeproject.com/KB/database/SubsonicDAL.aspx

    Read the article

  • How can i Write list type returning value in Linq with Entity FrameWork?

    - by programmerist
    How can i return List<personel> data type from below procedure. if i press F5 it throw me this error: Error 1 Cannot implicitly convert type 'System.Linq.IQueryable' to 'System.Collections.Generic.List'. An explicit conversion exists (are you missing a cast?) C:\Documents and Settings\yusufk\Desktop\EFTestSolutions\WebApplicationTest1\WebApplicationTest1\Default.aspx.cs 101 61 WebApplicationTest1 i think that: i should rearrange or recode "select new {. . . . " ? protected List<personel> GetPersonalsData2() { List<personel> personeller; using (FirmaEntities firmactx = new FirmaEntities()) { personeller = (from p in firmactx.Personals select new { p.ID, p.Name, p.SurName }); return personeller.ToList(); } } } public class personel { public int ID { get; set; } public string Name { get; set; } public string SurName { get; set; } }

    Read the article

  • DataGridView selectedRow Property not get Data if i double click Row?

    - by programmerist
    i click double dataGridView's any row. Not get Data clicked row data: private void gwStudies_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { GoruntuyuAc(); } private void GoruntuyuAc() { olduid = ""; DataRowView ro = (gwStudies.SelectedRows[0].DataBoundItem as DataRowView); string uid = ""; uid = ro["StudyInstanceUid"].ToString(); string tarih = ""; DateTime t1 = Convert.ToDateTime(ro["StudyDate"]); //........ //............ } Error Data on (gwStudies.SelectedRows[0].DataBoundItem as DataRowView); IMAGE:

    Read the article

  • Form Based Authentication problem?

    - by programmerist
    i have 2 pages : Login.aspx and Satis.aspx. i redirected from Login.aspx to Satis.aspx if authentication is correct . if i signout from satis i redirected to Login.aspx. But if i write satis.aspx' url on web scanner i entered satis.aspx. But i am not sign in Satis.aspx. i should't enter Satis.aspx directly. my web config: <authentication mode="Forms"> <forms loginUrl="Login.aspx" name=".ASPXFORMSAUTH" path="/" protection="All"> <credentials> <user name="a" password="a"></user> </credentials> </forms> </authentication> <authorization> <allow users="*"/> </authorization> </system.web> <location path="~/ContentPages/Satis/Satis.aspx"> <system.web> <authorization> <deny users="?"/> </authorization> </system.web> </location> Login.aspx.cs: protected void lnkSubmit_Click(object sender, EventArgs e) { if(FormsAuthentication.Authenticate(UserEmail.Value,UserPass.Value)) { FormsAuthentication.RedirectFromLoginPage (UserEmail.Value, PersistForms.Checked); } else Msg.Text = "Invalid Credentials: Please try again"; } Satis.aspx protected void LogoutSystem_Click(object sender, EventArgs e) { FormsAuthentication.SignOut(); Response.Redirect("~/Login/Login.aspx"); }

    Read the article

  • How to call base abstract or interface from DAL into BLL?

    - by programmerist
    How can i access abstract class in BLL ? i shouldn't see GenAccessor in BLL it must be private class GenAccessor . i should access Save method over _AccessorForSQL. ok? MY BLL cs: public class AccessorForSQL: GenoTip.DAL._AccessorForSQL { public bool Save(string Name, string SurName, string Adress) { ListDictionary ld = new ListDictionary(); ld.Add("@Name", Name); ld.Add("@SurName", SurName); ld.Add("@Adress", Adress); return **base.Save("sp_InsertCustomers", ld, CommandType.StoredProcedure);** } } i can not access base.Save....???????? it is my DAL Layer: namespace GenoTip.DAL { public abstract class _AccessorForSQL { public abstract bool Save(string sp, ListDictionary ld, CommandType cmdType); public abstract bool Update(); public abstract bool Delete(); public abstract DataSet Select(); } private class GenAccessor : _AccessorForSQL { DataSet ds; DataTable dt; public override bool Save(string sp, ListDictionary ld, CommandType cmdType) { SqlConnection con = null; SqlCommand cmd = null; SqlDataReader dr = null; try { con = GetConnection(); cmd = new SqlCommand(sp, con); con.Open(); cmd.CommandType = cmdType; foreach (string ky in ld.Keys) { cmd.Parameters.AddWithValue(ky, ld[ky]); } dr = cmd.ExecuteReader(); ds = new DataSet(); dt = new DataTable(); ds.Tables.Add(dt); ds.Load(dr, LoadOption.OverwriteChanges, dt); } catch (Exception exp) { HttpContext.Current.Trace.Warn("Error in GetCustomerByID()", exp.Message, exp); } finally { if (dr != null) dr.Close(); if (con != null) con.Close(); } return (ds.Tables[0].Rows.Count 0) ? true : false; } public override bool Update() { return true; } public override bool Delete() { return true; } public override DataSet Select() { DataSet dst = new DataSet(); return dst; } private static SqlConnection GetConnection() { string connStr = WebConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString; SqlConnection conn = new SqlConnection(connStr); return conn; }

    Read the article

  • How can i use ClearCanvas in remote database?

    - by programmerist
    How can i get data from REMOTE database using OnStart method? protected override int OnStart(StudyLoaderArgs studyLoaderArgs) { ApplicationEntity ae = studyLoaderArgs.Server as ApplicationEntity; _ae = ae; EventResult result = EventResult.Success; AuditedInstances loadedInstances = new AuditedInstances(); try { XmlDocument doc = RetrieveHeaderXml(studyLoaderArgs); StudyXml studyXml = new StudyXml(); studyXml.SetMemento(doc); _instances = GetInstances(studyXml).GetEnumerator(); loadedInstances.AddInstance(studyXml.PatientId, studyXml.PatientsName, studyXml.StudyInstanceUid); return studyXml.NumberOfStudyRelatedInstances; } finally { AuditHelper.LogOpenStudies(new string[] { ae.AETitle }, loadedInstances, EventSource.CurrentUser, result); } } i need to use OnStart in main project. How cn i use or call OnStart method

    Read the article

  • How can i return IEnumarable data from function in GridView with Entity FrameWork?

    - by programmerist
    protected IEnumerable GetPersonalsData() { // List personel; using (FirmaEntities firmactx = new FirmaEntities()) { var personeldata = (from p in firmactx.Personals select new { p.ID, p.Name, p.SurName }); return personeldata.AsEnumerable(); } } i wan to send GetPersonelData() into GridView DataSource. Like That: gwPersonel.DataSource = GetPersonelData(); gwPersonel.DataBind(); it monitored to me on : gwPersonel.DataBind(); this error: "The ObjectContext instance has been disposed and can no longer be used for operations that require a connection."

    Read the article

  • what knid of usage " [MenuAction("apply", "global-menus/MenuTools/MenuToolsMyTools/Tool1", "Apply")]

    - by programmerist
    MenuAction,ButtonAction,... etc why i need this type usage. i really what it is [ButtonAction("apply", "global-toolbars/ToolbarMyTools/Tool1", "Apply")]. Can you give me some tips or advise or site link. i don't really know [Myclass]. is it AOP? [MenuAction("apply", "global-menus/MenuTools/MenuToolsMyTools/Tool1", "Apply")] // Declares a toolbar button action with action ID "apply" // TODO: Change the action path hint to your desired toolbar path, or // remove this attribute if you do not want to create a toolbar button for this tool [ButtonAction("apply", "global-toolbars/ToolbarMyTools/Tool1", "Apply")] // Specifies tooltip text for the "apply" action // TODO: Replace tooltip text [Tooltip("apply", "Place tooltip text here")] // Specifies icon resources to use for the "apply" action // TODO: Replace the icon resource names with your desired icon resources [IconSet("apply", IconScheme.Colour, "Icons.Tool1Small.png", "Icons.Tool1Medium.png", "Icons.Tool1Large.png")] // Specifies that the enablement of the "apply" action in the user-interface // is controlled by observing a boolean property named "Enabled", listening to // an event named "EnabledChanged" for changes to this property [EnabledStateObserver("apply", "Enabled", "EnabledChanged")]

    Read the article

  • How can i return abstract class from any factory?

    - by programmerist
    using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace EfTestFactory { public abstract class _Company { public abstract List<Personel> GetPersonel(); public abstract List<Prim> GetPrim(); public abstract List<Finans> GetFinans(); } public abstract class _Radyoloji { public abstract List<string> GetRadyoloji(); } public abstract class _Satis { public abstract List<string> GetSatis(); } public abstract class _Muayene { public abstract List<string> GetMuayene(); } public class Company : _Company { public override List<Personel> GetPersonel() { throw new NotImplementedException(); } public override List<Prim> GetPrim() { throw new NotImplementedException(); } public override List<Finans> GetFinans() { throw new NotImplementedException(); } } public class Radyoloji : _Radyoloji { public override List<string> GetRadyoloji() { throw new NotImplementedException(); } } public class Satis : _Satis { public override List<string> GetSatis() { throw new NotImplementedException(); } } public class Muayene : _Muayene { public override List<string> GetMuayene() { throw new NotImplementedException(); } } public class GenoTipController { public object CreateByEnum(DataModelType modeltype) { string enumText = modeltype.ToString(); // will return for example "Company" Type classType = Type.GetType(enumText); // the Type for Company class object t = Activator.CreateInstance(classType); // create an instance of Company class return t; } } public class AntsController { static Dictionary<DataModelType, Func<object>> s_creators = new Dictionary<DataModelType, Func<object>>() { { DataModelType.Radyoloji, () => new _Radyoloji() }, { DataModelType.Company, () => new _Company() }, { DataModelType.Muayene, () => new _Muayene() }, { DataModelType.Satis, () => new _Satis() }, }; public object CreateByEnum(DataModelType modeltype) { return s_creators[modeltype](); } } public class CompanyView { public static List<Personel> GetPersonel() { GenoTipController controller = new GenoTipController(); _Company company = controller.CreateByEnum(DataModelType.Company) as _Company; return company.GetPersonel(); } } public enum DataModelType { Radyoloji, Satis, Muayene, Company } } if i write above codes i see some error: Cannot create an instance of abstract class or interface 'EfTestFactory_Company'How can i solve it? Look please below pic.

    Read the article

  • How to write linq query in Entity FrameWork but my table includes Foreignkey?

    - by programmerist
    i have a table it includes 3 foreignkey field like that: My Table: Kartlar ID (Pkey) RehberID (Fkey) KampanyaID (Fkey) BrimID (Fkey) Name Detail How can i write entity query with linq :? select * from Kartlar where RehberID=123 and KampanyaID=345 and BrimID=567 BUT please be carefull i can not see RehberID ,KampanyaID, BrimID in Entity they are Foreign Key. I should use Entity Key but How?

    Read the article

  • How can i use complextype class or multi type class is it generic collection?

    - by programmerist
    i need a complex returning type. i have 4 class returning types COMPLEXTYPE must include Company, Muayene, Radyoloji, Satis because i must return data switch case situation how can i do? Maybe i need generic collections How can i do that? public class GenoTipController { public COMPLEXTYPE Generate(DataModelType modeltype) { _Company company = null; _Muayene muayene = null; _Radyoloji radyoloji = null; _Satis satis = null; switch (modeltype) { case DataModelType.Radyoloji: radyoloji = new Radyoloji(); return radyoloji; break; case DataModelType.Satis: satis = new Satis(); return satis; break; case DataModelType.Muayene: muayene = new Muayene(); return muayene; break; case DataModelType.Company: company = new Company(); return company; break; default: break; } } } public class CompanyView { public static List GetPersonel() { GenoTipController controller = new GenoTipController(); _Company company = controller.Generate(DataModelType.Company); return company.GetPersonel(); } } public enum DataModelType { Radyoloji, Satis, Muayene, Company }

    Read the article

  • Simply doing modelType.ToString() isn't sufficient, How can i use it via Activator.CreateInstance?

    - by programmerist
    public class MyController { public object CreateByEnum(DataModelType modeltype) { string enumText = modeltype.ToString(); // will return for example "Company" Type classType = Type.GetType(enumText); // the Type for Company class object t = Activator.CreateInstance(classType); // create an instance of Company class return t; } } public class CompanyView { public static List<Personel> GetPersonel() { MyController controller = new MyController(); _Company company = controller.CreateByEnum(DataModelType.Company) as _Company; return company.GetPersonel(); } } public enum DataModelType { xyz, klm, tucyz, Company } Yes, I agree Activator.CreateInstance() is very useful. Unfortunately, I need to pass in the correct type. That means building the correct string to pass to Type.GetType(). If I trace through the call to Controller.CreatebyEnum() in the code I posted above, simply doing modelType.ToString() isn't sufficient, even for the case of DataModelType.Company. My solution'll be maintenance bottleneck. What would be better is something that takes the results of modelType.ToString() and then recursively searches through all the types found in all the assemblies loaded in the current AppDomain. According to MSDN, Type.GetType() only searches the current calling assembly, and mscorlib.dll. How can i do that? . i need best performance?

    Read the article

  • Transaction on Entity FrameWork Refactoring and best performance how can i?

    - by programmerist
    i try to use transaction in Entity FrameWork. i have 3 tables Personel, Prim, Finans. in Prim table you look SatisTutari (int) if i add data in SatisTutari.Text instead of int value adding float value. Trannsaction must be run! Everything is ok but how can i refactoring or give best performance or best writing Transaction coding! i have 3 table so i have 3 entities: CREATE TABLE Personel (PersonelID integer PRIMARY KEY identity not null, Ad varchar(30), Soyad varchar(30), Meslek varchar(100), DogumTarihi datetime, DogumYeri nvarchar(100), PirimToplami float); Go create TABLE Prim (PrimID integer PRIMARY KEY identity not null, PersonelID integer Foreign KEY references Personel(PersonelID), SatisTutari int, Prim float, SatisTarihi Datetime); Go CREATE TABLE Finans (ID integer PRIMARY KEY identity not null, Tutar float); Personel, Prim,Finans my tables. if you look Prim table you can see Prim value float value if i write a textbox not float value my transaction must run. protected void btnSave_Click(object sender, EventArgs e) { using (TestEntities testCtx = new TestEntities()) { using (TransactionScope scope = new TransactionScope()) { Personel personel = new Personel(); Prim prim = new Prim(); Finans finans = new Finans(); //-----------------------------------------------------------------------Step 1 personel.Ad = txtName.Text; personel.Soyad = txtSurName.Text; personel.Meslek = txtMeslek.Text; personel.DogumTarihi = DateTime.Parse(txtSatisTarihi.Text); personel.DogumYeri = txtDogumYeri.Text; personel.PirimToplami = float.Parse(txtPrimToplami.Text); testCtx.AddToPersonel(personel); testCtx.SaveChanges(); //----------------------------------------------------------------------- step 2 prim.PersonelID = personel.PersonelID; prim.SatisTutari = int.Parse(txtSatisTutari.Text); prim.SatisTarihi = DateTime.Parse(txtSatisTarihi.Text); prim.Prim1 = double.Parse(txtPrim.Text); finans.Tutar = prim.SatisTutari * prim.Prim1; testCtx.AddToPrim(prim); testCtx.SaveChanges(); //----------------------------------------------------------------------- step 3 lblTutar.Text = finans.Tutar.Value.ToString(); testCtx.AddToFinans(finans); testCtx.SaveChanges(); scope.Complete(); } } How can i rearrange codes. i need best practice refactoring and best solution for reading easly and performance!!!

    Read the article

  • Adding Data into tables iclueds Foreign Keys but Which New Row created Entity FrameWork ?

    - by programmerist
    Addding Data into kartlar Table (RehberID,KampanyaID,BrimID) is ok. But Which Kart'ID created? i need to learn Which Id created after Adding Data (RehberID,KampanyaID,BrimID) into Kartlar? public static List<Kartlar> SaveKartlar(int RehberID, int KampanyaID, int BrimID, string Notlar) { using (GenSatisModuleEntities genSatisCtx = new GenSatisModuleEntities()) { Kartlar kartlar = new Kartlar(); kartlar.RehberReference.EntityKey = new System.Data.EntityKey("GenSatisModuleEntities.Rehber", "ID", RehberID); kartlar.KampanyaReference.EntityKey = new System.Data.EntityKey("GenSatisModuleEntities.Kampanya", "ID", KampanyaID); kartlar.BirimReference.EntityKey = new System.Data.EntityKey("GenSatisModuleEntities.Birim", "ID", BrimID); kartlar.Notlar = Notlar; genSatisCtx.AddToKartlar(kartlar); genSatisCtx.SaveChanges(); List<Kartlar> kartAddedPatient; kartAddedPatient = (from k in genSatisCtx.Kartlar where k.RehberReference.EntityKey == RehberID && k.KampanyaReference.EntityKey == KampanyaID && k.BirimReference.EntityKey == BrimID select k) return kartAddedPatient ; } } How can i do that? i want to get data from Kartlar which data i added?

    Read the article

1 2  | Next Page >