c# - The operation is not valid for the state of the transaction. Something wrong with TransactionScope -
I have applied the transaction scope in my application. But I got the following error Operation is not valid for transaction status. Here is my code
try {using (System.Transactions.TransactionScope scope = new) system. Transnaces. TransactionScope ()) {Update Database 1 (); UpdateDataBase2 (); // This line throws the scope. Complete (); Both databases are on the same server (Server 1) (running MSDTC service). My application is on a different server (Server 2).
I googled around and found two posts with the same problem.
and
I found that there are 2 main reasons for my problem (1) MSDTC service and (2 ) Transaction scope can not be used to open the connection.
But when I test the same scenario in the local area it works, the work of the above 2 possible reasons is very good.I do not know what happens when I host them? >
Help me.
Comments
Post a Comment