这是我的代码,怎么加上事务
https://blog.csdn.net/hedy17/article/details/79379854
使用 TransactionScope
using (TransactionScope scope = new TransactionScope()) { //这里是你的增删改操作 scope.Complete();//这是最后提交事务 }