日期:2014-05-17 浏览次数:20574 次
TransactionOptions options = new TransactionOptions(); options.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted; options.Timeout = TransactionManager.DefaultTimeout; using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, options)) { try { //数据库添加操作 //数据库修改操作 scope.Complete(); } catch (Exception exp) { throw exp; } }