views:

30

answers:

2

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: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.) (.Net SqlClient Data Provider) Error Number: 10061

A: 

To fix your problem, can you provide follow info?

1) Is it remote connection? Do you have firewall enabled on your server?

2) On the server box, use "netstat -ano |findstr 1433", check whether it is your sql 2005 named instance by PID who is listening on the port? Or double check server errorlog to make sure sql 2005 named instance is listening on 1433.

3) From your client box, " telnet 1433 " does it work?

4) What is your connection string, do you have multiple instances installed on your server? If you connect to the sql 2005 named instance, you need specify in your connection string:

eg: Server= \ or

 Server=<remotemachinename>\<instancename>,1433

5) Double check sqlbrowser service is running on your server box.

Hopefully this will solve your problem

Rupeshit
yes it is a remote connection. no firewall
Fortubeks
A: 

If you're using SQL Server Express and you're trying to connect remotely, you need to first enable it for remote connections - those are turned OFF by default.

Check this blog post by the SQL Server Express team detailing the steps necessary.

marc_s