0
在此代码中将.commit()之后的SomeFunction()视为事务的一部分?如果有东西炸毁,它会回滚吗?插入动态记录后,我需要做进一步的处理,并且倾向于在一个大块中完成。Sqlclient事务和.Commit()
command.Transaction = transaction
Try
command.CommandText = _
"Insert into Region (RegionID, RegionDescription) VALUES (100, 'Description')"
command.ExecuteNonQuery()
transaction.Commit()
'do a function call here
SomeFunction()
Catch ex As Exception
transaction.Rollback()
End Try
嗯,我有点想通了。我会把它放在一个像我想避免的sp。感谢您的确认! – Somejerk 2012-04-22 01:23:18