Click here to Skip to main content
15,895,538 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Dear Friends,

Suppose I am having Database with two table eg. sc_Order And sc_OrderDetails

first i want to store data in sc_Order and then into sc_OrderDetails and these two table have 1 to many relation
sc_Order(1)------>(*)sc_OrderDetails

first add data to sc_Order and add OrderDetails to ICollection<sc_orderdetails>

C#
public partial class sc_Order
   {
       public sc_Order()
       {
           this.sc_Dispatch = new HashSet<sc_Dispatch>();
           this.sc_OrderDetails = new HashSet<sc_OrderDetails>();
       }
.................
.................
 public virtual ICollection<sc_OrderDetails> sc_OrderDetails { get; set; }
}


then i want to store ICollection<sc_orderdetails> items into sc_OrderDetails Table

how to store.....

please give me solution
Thanks in Advance.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900