How to insert table values using Entity frame work (Foreign key)???
-
Hi I have 2 table, Tab1(TID,Name Number) TID is PK Tab2(MID,TID,Description) TID is FK Both table data coming from different screens.... So i have 2 insert data individually So how can I insert? My Code: Tab1 T1=Tab1.CreateTab1(0); Tab2 T2 = Tab2.CreateTab2(0); T2.MID=200; T2.TID=300; T2.Description="Hellow"; Connection.AddToTab2(T2); Connection.SaveChanges(); But data is not inserting... its giving error.. Can some one help me plz..>>>
-
Hi I have 2 table, Tab1(TID,Name Number) TID is PK Tab2(MID,TID,Description) TID is FK Both table data coming from different screens.... So i have 2 insert data individually So how can I insert? My Code: Tab1 T1=Tab1.CreateTab1(0); Tab2 T2 = Tab2.CreateTab2(0); T2.MID=200; T2.TID=300; T2.Description="Hellow"; Connection.AddToTab2(T2); Connection.SaveChanges(); But data is not inserting... its giving error.. Can some one help me plz..>>>
Hi, Are you doing this in LINQ ? If so you wont be getting thisd trouble. Thanks, Thani
India is Mythical and so we are
-
Hi, Are you doing this in LINQ ? If so you wont be getting thisd trouble. Thanks, Thani
India is Mythical and so we are
-
HI, Why do you need to create tables ? you can create objects right. Create object ,assign property values and save them. Thanks, Thani
India is Mythical and so we are
-
HI, Why do you need to create tables ? you can create objects right. Create object ,assign property values and save them. Thanks, Thani
India is Mythical and so we are
-
Hi I have 2 table, Tab1(TID,Name Number) TID is PK Tab2(MID,TID,Description) TID is FK Both table data coming from different screens.... So i have 2 insert data individually So how can I insert? My Code: Tab1 T1=Tab1.CreateTab1(0); Tab2 T2 = Tab2.CreateTab2(0); T2.MID=200; T2.TID=300; T2.Description="Hellow"; Connection.AddToTab2(T2); Connection.SaveChanges(); But data is not inserting... its giving error.. Can some one help me plz..>>>
What is the error?
-
What is the error?