Question

How can I use an ADO.NET Manual Transaction to remove records across two databases (on same server)?

I came across this:

TransactionScope in .NET 1.1

But would still like to use .NET 1.1 Manual Transaction if possible.

Was it helpful?

Solution

Wow, been a while since I've looked at 1.1. An ado.net transaction is associated with a connection so there's not really a good way to do this in 1 manual transaction. I remember writing my own cross database txn management class where an executing command would basically register with it and I would keep track of the txns myself. Kind of my own TransactionScope or unit of work. I would roll back all of them if something erred or commit all of them at the end if a "complete" method was called.

The method in the article seems better other than it will invoke DTC (which is ok as long as you want that). I don't think there's a better way to do this.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top