title: How to use TransactionScope in C#?
body: <p>I am trying to use <code>TransactionScope</code>, but keep getting the exception below.<br>
  The app is running on a different machine than the database, if that matters.  I am using SQL Server 2005.</p>
  
  <blockquote>
    <p>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.</p>
  </blockquote>
  
  <pre><code>using (TransactionScope tsTransScope = new TransactionScope())
  {
      //Do stuff here
      tsTransScope.Complete();
  }
  </code></pre>
  
  <p><strong>Edit</strong></p>
  
  <p>I made some changes based on the feedback. Now I'm getting this error:</p>
  
  <blockquote>
    <p>"Error HRESULT E_FAIL has been returned from a call to a COM component."<br>
    "Communication with the underlying transaction manager has failed."</p>
  </blockquote>
  
  <p><strong>Solution</strong>
  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.</p>
  
  <p><strong>Here are the properties on the client:</strong><br>
  <a href="http://www.portnine.com/data/images/Misc/client.jpg" rel="nofollow noreferrer">Client http://www.portnine.com/data/images/Misc/client.jpg</a></p>
  
  <p><strong>Here are the properties on the server:</strong><br>
  <a href="http://www.portnine.com/data/images/Misc/server.jpg" rel="nofollow noreferrer">Server http://www.portnine.com/data/images/Misc/server.jpg</a></p>