title: The underlying provider failed to open , login failed for user IIS APPPOOL
body: <p>i am not a sql server guy but i am working on a client's application and want to connect to the database through EF Code first </p>
  
  <p><strong>the Exception message that i have is</strong></p>
  
  <blockquote>
    <p>The underlying provider failed to open</p>
  </blockquote>
  
  <p><strong>The Exception details</strong></p>
  
  <blockquote>
    <p>Cannot open database [DatabaseName] requested by the login. the login failed </p>
    
    <p>login failed for user 'IIS APPPOOL\ASP.NET v4.0"</p>
  </blockquote>
  
  <p><strong>My web config</strong></p>
  
  <pre><code>&lt;add name="TraininGoDB"
      providerName="System.Data.SqlClient"
      connectionString="Server=LOCALPCNAME\SQLEXPRESS;Database=[DATABASENAME];Integrated Security=True;"/&gt;
  </code></pre>
  
  <p><strong>The EF context and entities are defined in a separate project with the app config of the following</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;configuration&gt;
    &lt;configSections&gt;
      &lt;!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --&gt;
      &lt;section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /&gt;
    &lt;/configSections&gt;
    &lt;entityFramework&gt;
      &lt;defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework"&gt;
        &lt;parameters&gt;
          &lt;parameter value="Data Source=(localdb)\v11.0; Integrated Security=True; MultipleActiveResultSets=True" /&gt;
        &lt;/parameters&gt;
      &lt;/defaultConnectionFactory&gt;
    &lt;/entityFramework&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>i am using SQL Server Express 2008</p>
  
  <p>don't know the problem from the database configration or from the web config </p>