Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
error : 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)

I got the error when i uploaded my files over the server but on local host it is working fine.

Anyone can suggest me how to resolve this error.

What I have tried:

on local host, project is working fine but when i am uploading on the server then facig error "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)"
Posted
Comments
CHill60 13-Mar-24 8:46am    
Have you checked that SQL Server (on the server) is configured to allow remote connections?

 
Share this answer
 
On your localhost, SQL Server is most probably installed on your local machine, and your SQL Server connection string points to your local SQL Server. However when you deploy your application on a Server, usually SQL Server is installed on a separate Machine but your application connection string probably pointing to your local credentials (Maybe because you have not changed it).

You need to get your SQL Server credentials including IP, instance name, userId, and password, make a fresh connection string, update it on your App configuration file, and then hopefully you will be good to go.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900