title: IIS: Connecting to .mdf database - web config problem
body: <p>Locally I connect to Northwind.mdf but when I upload application to remote server then I get following error:</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>These are few options I tried:</p>
  
  <pre><code>&lt;connectionStrings&gt;
          &lt;add name="ConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Northwind.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/&gt;
      &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>The above one work locally.</p>
  
  <pre><code>&lt;connectionStrings&gt;
              &lt;add name="ConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=D:\ASP\TestSite\App_Data\Northwind.mdf; Integrated Security=True;Connect Timeout=30;User Instance=True;Trusted_Connection=Yes"/&gt;
          &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>On server is installed SQL Server 2005</p>
  
  <p>Thanks,<br>
  Ilija</p>