使用TransactionScope 实现事务管理

Posted on 2007-08-03 13:18  ant-boss  阅读(267)  评论(0)    收藏  举报
using (System.Transactions.TransactionScope updateTransaction = new System.Transactions.TransactionScope())
        {
            try
            {
                ProcesVerbalTableAdapters.dbcmxTableAdapter da = new ProcesVerbalTableAdapters.dbcmxTableAdapter();
                da.InsertQuery1();
            }
            catch
            {
                Response.Write("sdfsfd");
            }
            updateTransaction.Complete();
        }