When I used the .NET TransactionScope object to control a transaction in a web page the following error message greeted me
————————————————————————————————————————
MSDTC on server ‘GopinathM’ is unavailable.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: MSDTC on server ‘GopinathM’ is unavailable.
————————————————————————————————————————
This error occurs when the “Distributed Transaction Coordinator” service is not running. To start a distributed transactions with TransactionScope object, the windows service “Distributed Transaction Coordinator” should be running.
To fix the problem just start the service “Distributed Transaction Coordinator” using Windows Service manager.
Here are the detailed steps for starting the service
- Click on Start–>Control Panel->Administrative Tools->Services (or simply type services.msc in the run command box and hit enter); display “Services” manager
- Scroll through the list and identify the service “Distributed Transaction Coordinator”
- Right on the service and choose “Start”
When SQL Server and the Application Server are on different boxes
The above said solution work well when SQL Server and the Application are on the same box. If they are deployed on different boxes then additionally you should follow these steps to correct the problem
- Click Start–>Control Panel –> Adminstrative Tools –> Component Services –> Computers
- Right click on My Computer and choose Properties option
- Switch to MS DTC tab and check allow remote access
Repeat these steps on Application Server and Database server