title: Connection to SQL database failed.
body: <p>With my windows service application I am trying to connect 2 databases called db1 and db2.  Both db db1 and db2 are present in one SQL server. </p>
  
  <p>I am able to connect db1 using service and fetch required details but I am getting below error while connecting db2 </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: Named
    Pipes Provider, error: 40 - Could not open a connection to SQL Server)</p>
  </blockquote>
  
  <p>I guess this issue may be because of db/server name is incorrect in connection string  while connecting to db2. 
  This is working fine in development environment but not in live.<br>
  Is there any way so that we can find out what db/server name it is trying to connect without debugging.
  <strong>Is there anything like error logs for sql which will capture during connection?</strong></p>