Last post Sep 14, 2017 06:32 PM by PatriceSc
Sep 14, 2017 04:25 PM|ritul29|LINK
When I host my web application on server an error occurred:
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)
But its working completely fine on local host. Does any one have any idea what to do? I already search on the google followed the steps but still its not running.
Thanks in advance
Sep 14, 2017 04:37 PM|PatriceSc|LINK
This message happens when you can't reach at all the database server. It is common to not use the same server when developing on localhost and being hosted on the final web server. In this case you have to change the connection string. Have you done that
If you are sure the database server is already correct, it could be a firewall rule that prevents access to the database server from the web server.
Sep 14, 2017 06:05 PM|ritul29|LINK
Thanks for your helpful answer.
I used the same server but forgot to change the connection string but still When I try to enter id and password on my "Login.aspx" page and click onto login button then "Login.aspx" page reload and I wan't able to go to next page. This error occurs when
I run on final web server but when I Run on localhost its working fine.
Sep 14, 2017 06:32 PM|PatriceSc|LINK
This is the same database server but you had to change the connection string because it was using localhost as well ? If you are using SQL Server Express, you have to explicitly allow access from other machines.
Seeing the connection string could perhaps help. Change sensitive parts but please keep the structure intact ie if your server is W10RITUL29\DEV replace that with server\instance in the connection string you'll show (so that we still know you are using a
SQL Server instance).