is TransactionScope usable for sql operations, is it doing the same thing as Sqltransaction ?

Posted by Omu on Stack Overflow See other posts from Stack Overflow or by Omu
Published on 2010-05-31T09:27:50Z Indexed on 2010/05/31 9:32 UTC
Read the original article Hit count: 221

Filed under:
|
|

can I do something like this:

using (var scope = new TransactionScope())
            {
                using (var conn = new SqlConnection(Cs))
                {
                    using (var cmd = conn.CreateCommand())
                    {
                        cmd.CommandType = CommandType.StoredProcedure;
                       ...
                        scope.complete();

                    }
                }
            }

is going to be the same thing as using the SqlTransaction with catch(){rollback;}

© Stack Overflow or respective owner

Related posts about c#

Related posts about sql