0
votes

It is possible to connect database through management studio but while connecting the same through visual studio 2012,it gives following error on trying to open the connection....

"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)"

using windows authentication mode:- server name- SAKSHI-PC\SQLEXPRESS

connection string entry in app.config in visual studio:-

<add name="SoundFingerprinting.DuplicatesDetector.Properties.Settings.FingerprintsDbConnectionString"
      connectionString="Data Source=SAKSHI-PC\SQLEXPRESS;Initial Catalog=FingerprintsDb;Integrated Security=True"
      providerName="System.Data.SqlClient" />
1

1 Answers

0
votes
  1. Check your connection is pointing to correct SQL Server Instance
  2. Check that your SQL Server is up and running
  3. Check your SQL Server Browser service is up and running
  4. Check SQL Server is allowing remote connection or not.

http://blogs.msdn.com/b/walzenbach/archive/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008.aspx