Using tran As New Transactions.TransactionScope
Try
InsertaEnTabla1()
InsertaEnTabla2()
InsertaEnTabla3()
tran.Complete()
Catch ex As Exception
Console.WriteLine(ex.Message)
End Try
End Using
I am using this procedure to handle transactions in sqlserver, the point is that even if tran.com is not executed, it applies what was executed in the previous procedures, that is, if there is an exception in InsertInTable3 (), what you save in InsertTable1 () and InsertTable2 () is stored, does not Rollback ...