View Single Post
  #8 (permalink)  
Old 09-02-2007, 10:28 PM
S.Vinothkumar S.Vinothkumar is offline
D-Web Genius
 
Join Date: May 2007
Posts: 1,061
S.Vinothkumar is on a distinguished road
Wink Re: Transaction Scope in DotNet using C#.

If you look at a snippet of the SQL Server Transaction Template presented in my previous post, you can notice the transaction.Rollback() statement in the catch block that rolls back the entire transaction when an unexpected exception is thrown,

Code:
try
{
    // ...
    transaction.Commit();
}
catch
{
    transaction.Rollback();
    throw;
}
finally
{
    connection.Close();
}
I'm going to explain about those two methods in my upcoming posts....
__________________
S.VinothkumaR
Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!
Reply With Quote