hi,

I am using sql server 2000, but the following error will be occured on open a connection. Pls give solution for this error

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

please check your connection string ,permission to your db for accesing from your system or connectivity problem.

for example connection stirng:

Server=localhost;DataBase=northwind;UID=sa;Pwd=sa

Please check your connection string in your web.config file,if you have used in web.config..And also check ur database(which u r trying to access) username and pwd is correct

Also check the surface area configuration for your SQL 2005 server. Through there you can verify if remote connections are enabled.

If you use Sql Server Management studio then:

open.
Connect to the remote server.Right click on the server instance.Select properties.
Click Connections.Check to allow remote connections to this server.

If you use Express or Developer edition then follow the below steps:

Click Start -->> Programs -->> Microsoft SQL Server 2005 -->>
Configuration Tools -->> SQL Server Surface Area Configuration.
Now click Surface Area Configuration for Services and Connections.
Now expand Database Engine, click Remote Connections, click Local and remote connections, click the appropriate protocol to enable for your environment, and then click Apply.

IF STILL NOT RESOLVED YOU CAN READ BELOW POST:
http://http://shawpnendu.blogspot.com/2009/04/how-to-configure-sql-server-2005-to.html

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.