title: How to test a sql server connection windows authentication from .Net Project Test outside the domain
body: <p>Here is the cenario:</p>
  
  <p>I have an account created on Active Directory named <b>Test</b>.</p>
  
  <p>This account have permission to <b>read</b> the instance of database.</p>
  
  <p>I can access the data inside the domain> through SQL Server Visual Management Studio with Windows Authentication.</p>
  
  <p>Now the problem:</p>
  
  <p>How can I outside> the domain will access this data with a .NET Project Test?</p>
  
  <p>I put this in my app.config:</p>
  
  <pre><code>&lt;connectionStrings&gt;
     &lt;add name="CRM" connectionString="Data Source=server; Initial Catalog=catalog; Integrated Security=SSPI; providerName="System.Data.SqlClient"/&gt;
  &lt;/connectionStrings&gt;
  &lt;system.web&gt;
     &lt;identity impersonate="true" userName="domain\user" password="pass"/&gt;
  &lt;/system.web&gt;
  </code></pre>
  
  <p>But i'm still getting this error:</p>
  
  <blockquote>
    <p>Login failed for user 'x'. The user is not associated with a trusted SQL Server connection.</p>
  </blockquote>
  
  <p>The last and not least, yes i do have both SQL and windows authentication mode enabled.</p>