![]() |
1
1
尝试将SqlConnection放置在TransactionScope中,然后它会自动登记到事务中。
http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx 抱歉,刚才抓到了您的操作-可能是因为连接没有配置为自动登记到现有事务中(我认为是连接字符串的一个成员)。
当然,在当前的代码示例中,您可以安全地使用SqlTransaction对象,因为您不涉及多个连接/数据库。 |
![]() |
2
2
|
![]() |
3
0
|
![]() |
Van Thoai Nguyen · MSSQL如何正确锁定行并插入? 9 年前 |
![]() |
bilpor · MSMQ忽略事务作用域 10 年前 |
![]() |
Aleksandar · 获取事务的开始和结束时间-SQL Server 11 年前 |