I needed to connect to sql server from a remote computer which is on my home lan.
But got this error message.
An error has occurred while establishing a connection to the server. When
connecting to SQL Server 2005, the failure may be caused by the fact that
under the default settings SQL Server does not allow remote connections.
(provider: TCP Provider error: 0 – No connection could be made because the
target machine actively refused it.) (Microsoft SQL Server, Error: 10061)
After some googling I understand what was the problem. I have to allow remote connection in Surface Area Configuration.
Click Start > All Programs > SQL Server 2005 > Configuration Tools > SQL Server Surface Area Configuration.
Select Option “Surface Area Configuration for services and connection“.
Select the sql server component for which you want to allow remote connection.
Select “remote connection“, you will now be able to see the settings for this instance. If you want to allow remote connections. Then Select “Local and Remote Connections” Then “Using both TCP/IP and Named Pipes” then Apply.
Restart the Sql Server Service
Click Start > Run > Type “Services.msc” > Right Click on your SQL Server Instance > Restart the service.
Now your SQL Server is ready to accept the remote connections.