title: Unable to connect to SQL Server 2008 r2 with C# web project, Error: Connection string not valid
body: <p>I have created basic login module in ASP.net using C#. I am using C# web application for this purpose.</p>
  
  <p>Earlier I used SQL Server 2008 Express as a database. At that time application was running fine.</p>
  
  <p>But then I uninstalled that database and installed SQL Server 2008 R2.</p>
  
  <p>From that point onwards I am getting error:</p>
  
  <blockquote>
    <p><em>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: 25 - Connection string is not valid)</em></p>
  </blockquote>
  
  <p>I found in <code>config.xml</code> I have code as:</p>
  
  <pre><code>&lt;connectionStrings&gt;
      &lt;add name="ApplicationServices"
           connectionString="data source=.\SQLEXPRESS ;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true"
           providerName="System.Data.SqlClient" /&gt;
    &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>where  my SQL Server is called <code>MSSQLSERVER</code>.</p>
  
  <p>This connection string must be the issue. But I am not able to resolve this issue.</p>
  
  <p>Is my conclusion correct and can I get some help?</p>
  
  <p>PS: my SQL Server 2008 R2 is installed correctly.</p>
  
  <p>But whenever I try to connect with SQL Server 2008 R2 its connecting to 2008, which is uninstalled but have same name. (both earlier and this server have same name i.e. my computer name.)</p>