title: LocalDb error when accessing data "The underlying provider failed on Open"
body: <p>I'm currently attempting to connect to a local copy of a database for testing purposes as to not alter live data.</p>
  
  <p>I'm using MVC with Entity Framework (.Net 4.5), and I'm currently running into this error whenever I attempt to access data through EF:</p>
  
  <pre><code>An exception of type 'System.Data.EntityException' occurred in System.Data.Entity.dll but was not handled in user code
  
  Additional information: The underlying provider failed on Open.
  </code></pre>
  
  <p>This is the function that is trying to access the data - the error happens on the first line</p>
  
  <pre><code>public IEnumerable&lt;Client&gt; GetClients()
  {
      List&lt;Client&gt; clients = (from c in this.repository.Clients select c).ToList();
      return clients;
  }
  </code></pre>
  
  <p>Here is my connection string in the app.config as well:</p>
  
  <pre><code>&lt;add name="EntitiesConnectionString" connectionString="metadata=res://*/EFName.csdl|res://*/EFName.ssdl|res://*/EFName.msl;provider=System.Data.SqlClient;provider connection string=&amp;quot;Data Source=(LocalDb)\v11.0;Initial Catalog=testdb;Integrated Security=True;Pooling=False&amp;quot;" providerName="System.Data.EntityClient" /&gt;
  </code></pre>
  
  <p>I'm using the integrated SQL Server Express that comes with Visual Studio 2015 to manage the local DB that I have created.</p>
  
  <p>More information that I've found:</p>
  
  <pre><code>"Cannot open database \"testdb\" requested by the login. The login failed.\r\nLogin failed for user 'NT AUTHORITY\\SYSTEM'."
  </code></pre>
  
  <p>I don't believe that I have any permissions set on the db that I created, perhaps something is wrong with the connection string?</p>
  
  <p>Edit:</p>
  
  <p>I've added the 'NT AUTHORITY\NETWORK SERVICE' user, and then added it to the 'db_owner' role in MS SQL Server Management Studio without any luck</p>
  
  <p>I also attempted to create a new login and user with credentials and the 'db_owner' role, and I still receive the same "Login failed for user 'user'."</p>
  
  <p>This is the connection string that I'm using with the test user that I created:</p>
  
  <pre><code>&lt;add name="EntitiesConnectionString" connectionString="metadata=res://*/EFName.csdl|res://*/EFName.ssdl|res://*/EFName.msl;provider=System.Data.SqlClient;provider connection string=&amp;quot;Data Source=(LocalDb)\v11.0;Initial Catalog=testdb;Integrated Security=False;Persist Security Info=True;User ID=test;Password=password&amp;quot;" providerName="System.Data.EntityClient" /&gt;
  </code></pre>