Wednesday, December 14, 2011

Transactions

using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required, new TimeSpan(2, 0, 0)))
            {
             //your insert/delete/update here.
                ts.Complete();
            }


Note:  If any operation fails then it will rollback automatically.

No comments:

Post a Comment