Since I am new to working with linq in a C# 2010 asp.net web forms application, I have the following question to ask:
In some new code that I need to write, I need to insert a new row in org1 table where the identity (key) column is called org1_id. I also need to insert a row in org2 table that has org1_id column as foreign key (that is associated with org1 table.
How would you accomplish this task?
The following is what i have so far:
org = new Organization();
PopulateOrganization(org);--puts data in all the appropriate columns
orgModuleDataContext.Organizations.InsertOnSubmit(org);
scampercatPosted Oct 25, 2011, 9:44 AM
However, I do not know how to setup the following in linq to sql:
1. table_1 has identity column called org1_id,
2. table_2 has org1_id has just a regular column. Here it is a foreign to the main table.
How do you set this up in linq to sql?
Mamta MPosted Oct 25, 2011, 2:43 AM