简体   繁体   中英

Connection from Visual Studio to SQL Server 2005

In Visual Studio 2010 I am trying to set up a connection with a SQL Server database with the add connection wizard but the connection fails!

This is the error I get:

a network-related or instance-specific error occured 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)

Extra info;

  • I can ping the server!
  • Remote connections are allowed on the SQL Server!
  • SQL service is running!

What is here the problem?

To work around this problem, use one of the following methods depending on the symptom that you are experiencing:

  • A SQL Server login

Use a valid Windows login to connect to SQL Server. If you must continue to use a SQL Server login, you can change the security authentication mode in SQL Server to SQL Server and Windows.

  • A Windows account with insufficient permissions

To work around this problem, you must add the Windows account to SQL Server, and then grant the appropriate permissions to each database that the user requires access to.

Source: http://support.microsoft.com/kb/889615/en-us

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM