[Resolved] Visual Studio Connect to Microsoft SQL Server Database Failed - A network-related or instance-specific error occurred

Visual Studio Tools Connect to Database
Issue: Visual Studio Connect to Microsoft SQL Server Database Failed - A network-related or instance-specific error occurred
Error Message:
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) (Microsoft SQL Server, Error: 1326)
Description: When attempting to connect to a database from Visual Studio, if you are getting a message from Visual Studio Data Connection that it was not able to connect to SQL Server, check the following workaround.

Steps:
  • Open Visual Studio > Tools > Connect to Database
  • Choose Data Source > Continue 
visual studio Data Source Continue

  • The Server Name auto populates 

  • If you proceed with the auto populated server name, and try to select databases below, the following error is displayed 

visual studio connect to database error
Workaround:
  • Open Visual Studio > Tools > Connect to Database 
  • Choose Data Source > Continue 
  • The Server Name auto populates
  • Edit the server name to "Computername\SQL Server instance"
Example: SERVERNAME\SQLEXPRESS

visual studio connect to database server name 2


We are not able to see the list of databases and we can select.
  • Select the required database
  • Test Connection.
  • Click OK



No comments