I am trying to use TransactionScope
, but keep getting the exception below.
The app is running on a different machine than the database, if that matters. I am using SQL Server 2005.
Network access for Distributed Transaction Manager (MSDTC) has been disabled. Please enable DTC for network access in the security configuration
for MSDTC using the Component Services Administrative tool.
using (TransactionScope tsTransScope = new TransactionScope())
{
//Do stuff here
tsTransScope.Complete();
}
Edit
I made some changes based on the feedback. Now I'm getting this error:
"Error HRESULT E_FAIL has been returned from a call to a COM component."
"Communication with the underlying transaction manager has failed."
Solution
I think the accepted answer fixed the initial issue I was getting. The 2nd error seems to be specific to Entity Framework. I'll post another question for it.
Here are the properties on the client:
Client http://www.portnine.com/data/images/Misc/client.jpg
Here are the properties on the server:
Server http://www.portnine.com/data/images/Misc/server.jpg
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…