Reputation: 15817
Please see the below:
Using scope As New System.Transactions.TransactionScope
//Create instance of connection 1 and open
//Create instance of connection 2 and open
//Create instance of connection 3 and open
scope.complete()
End Using
Is there a way of excluding connection 2 from the transaction. The reason is because the database server that connection2 connects to does not have Transactions enabled. I am planning to enable it but it has to go through the "change process", which takes weeks. Therefore I am looking for a quick win.
Upvotes: 1
Views: 159
Reputation: 43023
You can simply create the 2nd connection before the transaction:
//Create instance of connection 2 and open
Using scope As New System.Transactions.TransactionScope
//Create instance of connection 1 and open
//Create instance of connection 3 and open
scope.complete()
End Using
Upvotes: 1