2
Reply

C# 2010 linq in web app

scampercat

scampercat

Oct 24 2011 6:30 PM
1.2k

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);


Answers (2)