Question About TransactionScope in .NET

Posted by peace on Stack Overflow See other posts from Stack Overflow or by peace
Published on 2010-05-30T13:53:54Z Indexed on 2010/05/30 14:12 UTC
Read the original article Hit count: 283

           using (TransactionScope scope = new TransactionScope())
           {
                int updatedRows1 = custPh.Update(cust.CustomerID, tempPh1, 0);
                int updatedRows2 = custPh.Update(cust.CustomerID, tempPh2, 1);
                int updatedRows3 = cust.Update();

                if (updatedRows1 > 0 && updatedRows2 > 0 && updatedRows3 > 0)
                {
                    scope.Complete();
                }
           }

Is the above TransactionScope code structured correctly? This is my first time using it so i'm trying to make as simple as i can.

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET