Monday, January 08, 2007

An error has occurred while establishing a connection to the server.

Error Description :: 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)

Solution 1:

Go to, Start >> Programs >> Microsoft SQL Server 2005 >> Configuration Tools >> SQL Server 2005 Surface Area Configuration >> Surface Area Configuration for Services and connections.

Within this check whether "Local and remote connections" is choosen. If not choose it :)

Solution 2:

Check this URL :)

Technorati tags:


Anonymous said...


I did all the steps whatever u mention in the mail.But still i am getting same problem.

Please help me..


Anonymous said...

Hello i have a possible solution , in the moment i installed the sql 2005 i quit the service of SQLSERVER, before u can work with databases or other services maybe, u can try this:
Programs/Microsoft SQL Server 2005/ Configuration Tools/ SQL Server Configuration Manager, and chance the state of the proccess: SQL Server (MSSQLSERVER) to Running.

GL :)

svandanapu said...

Hi i am using sqlserver 2000 and VS 2005. i am getting the same error while i am tranferring some data from one data base to another data base with dotnet application using VS 2005 where 2 data bases are existed on same server and the server(data base) is sqlserver 2000. can you please give me solution for me.


Anonymous said...

Try starting the SQLSERVERAGENT service on the SQL2000 server. Don't know why that's needed but it worked for me!

Anonymous said...

Antivirus programs can also cause this problem.


Anonymous said...

hey buddy the first solution worked for me :) thank u....