LINQ and TransactionScope

The DataContext object supports using the TransactionScope object, defined in the System.Transactions namespace.  You can easily do the following in your code:

using (TransactionScope ts = new TransactionScope())
{
    myContext.SubmitChanges();
    ts.Complete();
}

If there is an issue, it's raised as an exception and the changes are not submitted in that case.

Published Thursday, February 28, 2008 5:01 AM by bmains
Filed under:

Comments

No Comments

The leading UI suite for ASP.NET - Telerik radControls
Outstanding performance. Full ASP.NET AJAX support. Nearly codeless development.