title: Using Windows Authentication with Connection string in IIS to connect to SQL 2008 R2
body: <p>I'm am making a model first website using MVC4 on IIS7.</p>
  
  <p>Currently my connection string looks like this:</p>
  
  <pre><code>&lt;add name="VaultEntities"  
      connectionString="metadata=res://*/Models.VaultDB.csdl|res://*/Models.VaultDB.ssdl|res://*/Models.VaultDB.msl;provider=System.Data.SqlClient;
           provider connection string=&amp;quot;
           data source=sqlserver\instance;
           initial catalog=vault;
           integrated security=True;
           multipleactiveresultsets=True;
           App=EntityFramework&amp;quot;" 
           providerName="System.Data.EntityClient" /&gt;
  </code></pre>
  
  <p>The connection was auto generated by Visual Studio 2011 when I added the database through the Model First approach. The query works perfectly locally on my development machine. But it dosen't work on the IIS server.</p>
  
  <p>My guess is that this is because my user account on my development machine has access to the SQL server and when IIS tries to access the SQL server its user account gets denied.</p>
  
  <p>In a perfect world I would add a user on the SQL server and use</p>
  
  <pre><code>User Id=myUsername;Password=myPassword;
  </code></pre>
  
  <p>in my connection string, unfortunately I don't have that option. </p>
  
  <p>Without going into details the dba's are...difficult...to work with.</p>
  
  <p>So is there any way to use my AD account in the connection string to login to the SQL server... Or can I make IIS identify itself as me?</p>