title: Access to SQL Server 2005 from a non-domain machine using Windows authentication
body: <p>I have a Windows domain within which a machine is running SQL Server 2005 and which is configured to support only Windows authentication. I would like to run a C# client application on a machine on the same network, but which is NOT on the domain, and access a database on the SQL Server 2005 instance.</p>
  
  <p>I thought that it would be a simple matter of doing something like this:</p>
  
  <pre><code>string connectionString = "Data Source=server;Initial Catalog=database;User Id=domain\user;Password=password";
  SqlConnection connection = new SqlConnection(connectionString);
  connection.Open();
  </code></pre>
  
  <p>However, this fails: the client-side error is:  </p>
  
  <blockquote>
    <p>System.Data.SqlClient.SqlException: Login failed for user 'domain\user'
    and the server-side error is: Error 18456, Severity 14, State 5</p>
  </blockquote>
  
  <p>I have tried various things including setting integrated security to true and false, and \ instead of \ in the User Id, but without success.</p>
  
  <p>In general, I know that it possible to connect to the SQL Server 2005 instance from a non-domain machine (for example, I am working with a Linux-based application which happily does this), but I don't seem to be able to work out how to do it from a Windows machine.</p>