locked
Will SQLTransaction Roll back if I didn't call Transaction.Commit() ? RRS feed

  • Question

  • HI all,

    I have some functions use SQLTransaction assigned with some SQLCommand, and exception happened, if i didn't rollback and directly return the fucntion without calling SQLTransaction.Commit(), will there be any possible problems?

    Using(SQLConnection conn = New SQLConnection(string))

    {

           var Tran = Conn.BeginTransaction();

           return;

           Tran.Commit();

    }

    many thanks.


    James
    Friday, June 3, 2011 7:03 AM

Answers