title: Unable to connect to SQL Server using a connection string with Windows authentication
body: <p>I'm trying to connect to my single SQL Server Express instance using Windows authentication after following this particular tutorial (<a href="https://www.youtube.com/watch?v=Lrr66APUwBk&amp;list=PL6n9fhu94yhVm6S8I2xd6nYz2ZORd7X2v&amp;index=8" rel="nofollow noreferrer">Tutorial</a>)</p>
  
  <p>Here is the connection string:</p>
  
  <pre><code>&lt;connectionStrings&gt;
      &lt;add name="EmployeeContext" 
           connectionString="Server=.\SQLEXPRESSDAZ; database=Employee; Integrated Security = SSPI"
           providerName="System.Data.SqlClient"/&gt;
  &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>I've been in SSMS and made sure my user mappings are set to <code>db_owner</code> and that the <code>Employee</code> table is the default table for the user: <code>domain\name</code>.  </p>
  
  <p>However, after many combinations of key/value pairs I tried after seeing many examples, I get the error: </p>
  
  <blockquote>
    <p><strong>The system cannot find the file specified</strong></p>
    
    <p>SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server.....</p>
  </blockquote>
  
  <p>I've even tried creating new users with user mappings to the Employee DB and changing <code>Integrated Security = SSPI</code> to a <code>user id</code> and <code>password</code>, and still I cannot connect to this instance locally.</p>
  
  <p>Here is a screen grab of SSMS:</p>
  
  <p><a href="https://i.stack.imgur.com/i52xU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/i52xU.png" alt="enter image description here"></a></p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I've changed the server attribute to: <code>Server=localhost\SQLEXPRESS</code> and added: <code>Initial Catalog=dbo</code> and I have this error now:</p>
  
  <p><code>Cannot open database "Employee" requested by the login. The login failed.
  Login failed for user 'xxxxx\DESKTOP-AIE9SAE$'.</code></p>
  
  <p>In terms of my code (which can been seen in the Tutorial link), it seems to always be referencing this <code>line 15</code> if it helps:</p>
  
  <p><code>Employee employee = employeeContext.Employees.Single(emp =&gt; emp.EmployeeId == id);</code></p>
  
  <p><strong>UPDATE 2</strong></p>
  
  <p>SSMS Security Logins and Users</p>
  
  <p><a href="https://i.stack.imgur.com/au6Cu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/au6Cu.png" alt="Security"></a> <a href="https://i.stack.imgur.com/7HSfo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7HSfo.png" alt="Users"></a></p>