Mental Jetsam

By Peter Finch

Archive for October, 2007

Problem Connecting to SQL Server over TCP/IP

Posted by pcfinch on October 23, 2007

After installing SQL Server Express 2005 I was not able to connect to it using Visual Studio Server Explorer but I was able to connect to the database server using the SQL Server Management Studio Express. Visual Studio was giving me the following error.

An error has occurred while establishing a connection to the server. When connecting to the SQL server 2005, this failure may be caused by the fact that under the default settings SQL server does not allow remote connection. (Provider: TCP Provider, error : 0 – No connection could be made because the target machine actively refused it.)

Configure SQL Server TCP/IP PortI had already used the SQL Server Surface Area Configuration to enable TCP/IP, the Management Studio to Enable both Windows and SQL Server Authentication modes and I had even enabled port 1433 on the windows firewall, but still I could not connect.

I found that the port settings in the “TCP/IP Properties – IP Address” dialog of the “SQL Server Configuration Manager” were actually blank. I had to enter port 1433 manually into each of the “TCP Port” fields and after restarting the SQL Server service everything worked fine.

Posted in C#.NET | 1 Comment »