Reputation: 3
I've just designed my database in SQL Server 2008 and now that I'm starting the actual implementation I have the following concern: I have a view (an aspx page) which submits a student registering to an institute. This page insert is related to about 3 tables (student/parents and address). How can i insert the details collected to the 3 tables simultaneously using linq to sql?
Upvotes: 0
Views: 160
Reputation: 2706
You would have three insert statements. If you need them to all fail or succeeded, put them in a transaction.
using (var transaction = new TransactionScope())
{
try
{
//insert statements
transaction.Complete();
}
}
Upvotes: 1