title: sql server 2008 Login failed for user 'NT AUTHORITY\NETWORK SERVICE'
body: <p>I am trying to connect my website to my sql server 2008 r2 on windows server 2003 with .net framework 4</p>
  
  <p>This is the connection string:</p>
  
  <pre><code>&lt;add name="TestDbConnectionString" 
       connectionString="Data Source=(local);Initial Catalog=RESv5;integrated security=SSPI;"
       providerName="System.Data.SqlClient" /&gt;
  </code></pre>
  
  <p>I got an exception, which is:</p>
  
  <blockquote>
    <p>Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.<br>
    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.</p>
    
    <p>Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.</p>
    
    <p>Source Error:</p>
    
    <p>An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.</p>
  </blockquote>
  
  <p>I saw this question <a href="https://stackoverflow.com/questions/2251839/login-failed-for-user-nt-authority-network-service">Login failed for user &#39;NT AUTHORITY\NETWORK SERVICE&#39;</a> and I tried to make a user named as <code>NT AUTHORITY\NETWORK SERVICE</code> but I still have the problem,</p>
  
  <h3>edit1</h3>
  
  <p>I have already tried to use a username and password. this is the connection string</p>
  
  <pre><code>&lt;add name="TestDbConnectionString" 
       connectionString="Data Source=(local);Initial Catalog=RESv5;integrated security=SSPI;User Id=sa;Password=myPassword;"
       providerName="System.Data.SqlClient" /&gt;
  </code></pre>
  
  <p>but still have the problem</p>