title: How to solve the system.data.sqlclient.sqlexception (0x80131904) error
body: <p>I've created an application that works perfectly on my PC using C# and SQL Server 2008 R2. My connection string is:</p>
  
  <pre><code>connectionString="Data Source=KELVIN-PC;Initial Catalog=LMS;User ID=sa;Password=temperament"
  </code></pre>
  
  <p>But I have published it and installed it on another PC. I also copied the <code>LMS.bak</code> file to the PC and restored the database on it <code>MS SQL Server 2008 R2</code>. But whenever it has to connect to the database on the other machine it gives the error below:</p>
  
  <blockquote>
    <p>System.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while extablishing 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: Named pipes Provider, error:40 - Could not open a connection to SQL Server).....</p>
  </blockquote>
  
  <p>I've spent hours searching through the internet but most answered problems have a little difference from my own and some suggestions I have tried didn't really work.</p>