Can anyone know why this error comeing?
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)how to solve this error?
check these things
1. Make sure your database engine is configured to accept remote connections(I you are using centralized database)
•Start > All Programs > SQL Server 2005 > Configuration Tools > SQL Server Surface Area Configuration
•Click on Surface Area Configuration for Services and Connections
•Select the instance that is having a problem > Database Engine > Remote Connections
•Enable local and remote connections
2. Check the SQL Server service account
•If you are not using a domain account as a service account (for example if you are using NETWORK SERVICE), you may want to switch this first before proceeding
3.If you are using a named SQL Server instance, make sure you are using that instance name in your connection strings in your ASweb P.NET application
•Usually the format needed to specify the database server is machinename\instancename
•Check your connection string as well
The error is pretty explicit - and it even tells you what to do.
Check your connection string - in all probability it does not reference the SQL server instance correctly.
You can check if your computer name and the user name is same or different. if same please change the user name or computer name. u can give it a try, coz i tried all blogs, forums, Google search and lots of things for almost 1 year to solve this problem. finally i did this and it solved my problem.
Please go Control Panel\All Control Panel Items\Administrative Tools\services and start SQL SERVER(SQLEXPRESS).it will work.
Try adding a , and a port number as in ",1433" to the end of your connection string.
Its possible that WMI or some other service dependency required to resolve the database instance name wasnt working on you local machine.
Manually specifying the port will resolve this.
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)