title: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified
body: <p>Well i have a big problem that i'm trying for days to solve but i could not do it, so i need your help. I have a web application in asp.net 4.0 where i implemented custom membership and role providers. When i open the app homepage in it connects to the database and retrieves some information. There is also a login form and when i login it validates the user through the database and redirects me to the reserved pages but than this error appears:</p>
  
  <blockquote>
    <p>A network-related or instance-specific error occurred while
    establishing a connection to SQL Server. The server was not found or
    was not accessible. Verify that the instance name is correct and that
    SQL Server is configured to allow remote connections. (provider: SQL
    Network Interfaces, error: 26 - Error Locating Server/Instance
    Specified)</p>
  </blockquote>
  
  <p><strong>Description:</strong> </p>
  
  <blockquote>
    <p>An unhandled exception occurred during the execution of the current
    web request. Please review the stack trace for more information about
    the error and where it originated in the code.</p>
  </blockquote>
  
  <p><strong>Exception Details:</strong> </p>
  
  <blockquote>
    <p>System.Data.SqlClient.SqlException: A network-related or
    instance-specific error occurred while establishing a connection to
    SQL Server. The server was not found or was not accessible. Verify
    that the instance name is correct and that SQL Server is configured to
    allow remote connections. (provider: SQL Network Interfaces, error: 26
    - Error Locating Server/Instance Specified)</p>
  </blockquote>
  
  <p><strong>Source Error:</strong> </p>
  
  <blockquote>
    <p>An unhandled exception was generated during the execution of the
    current web request. Information regarding the origin and location of
    the exception can be identified using the exception stack trace below.</p>
  </blockquote>
  
  <p>I tried many things, some solution i found in <b>stackoverflow</b> but nothing worked. Here are my connectionstrings:</p>
  
  <pre><code>&lt;connectionStrings&gt;
    &lt;clear/&gt;
    &lt;remove name="LocalSqlServer"/&gt;
       &lt;add name="LocalSqlServer" connectionString="Data Source=MSSQL2008-1;Initial Catalog=agency;
          Integrated Security=False;User ID=adis_agency;Password=niarda2012;Connect Timeout=180;Encrypt=False;
          Packet Size=4096" providerName="System.Data.SqlClient" /&gt;
       &lt;add name="AgencyConn" connectionString="Data Source=MSSQL2008-1;Initial Catalog=agency;
          Integrated Security=False;User ID=adis_agency;Password=niarda2012;Connect Timeout=180;Encrypt=False;
          Packet Size=4096" providerName="System.Data.SqlClient"/&gt;
  &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>Below are also the membership and role manager web.config section:</p>
  
  <pre><code>&lt;membership defaultProvider="AuthProvider"&gt;
    &lt;providers&gt;
      &lt;clear/&gt;
        &lt;add name="AuthProvider" type="AuthenticationProvider" applicationName="~/Reserved/" connectionStringName="AgencyConn"/&gt;
    &lt;/providers&gt;
  &lt;/membership&gt;
  &lt;roleManager enabled="true" defaultProvider="MyRoleProvider"&gt;
    &lt;providers&gt;
      &lt;clear/&gt;
        &lt;add name="MyRoleProvider" type="RoleAccessProvider" connectionStringName="AgencyConn"/&gt;
    &lt;/providers&gt;
  &lt;/roleManager&gt;
  </code></pre>
  
  <p>Please can anybody help to figure out whats wrong?</p>