[ACCEPTED]-Connect to SQL Server 2008 with TCP/IP-database-connection
The thing I usually forget is that even 5 if you mark tcp as enabled in SQLServerNetwork->Protocols 4 for MSSQLServer, you still need to go and 3 enable the potentially different IP addresses 2 for your server. Even a server with a single 1 NIC will have multipe IP addresses.
- Click on the Protocols for MSSQLServer as listed above.
- Then in the right hand pane enable TCP/IP.
- Now double click TCP/IP to get a dialog window.
- If you want to listen on all the IP addresses for the server Select Yes in the Listen All box on the first Protocol tab; otherwise
- Select the IP Addresses tab and enable the desired IP addresses by setting Enabled to Yes.
When you check the SQL Server Network Configuration 9 (Start Menu > Microsoft SQL Server > Configuration Tools > SQL Server Configuration Manager > SQL Server Network Configuration
), what do you see?
Is the TCP/IP protocol 8 really enabled on your server? It's off 7 by default, and stays off in most cases 6 (unless you specifically turn it on).
Just 5 using a IP-based server address doesn't 4 mean you're connecting using the TCP/IP 3 protocol.... check http://www.connectionstrings.com/sql-server-2008 for a sample connection 2 string that will use TCP/IP:
Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;
The key is the Network Library=DBMSSOCN;
which 1 tells your code to connect using TCP/IP.
Also worth checking that the SQL Server 2 Browser Service is running as TCP/IP connections 1 will use this service
Have a look at www.connectionstrings.com. Error 4 message looks like you're using named pipes 3 and not tcp/ip. Don't forget you must enable 2 TCP/IP on server machines for SQL Server 1 explicitly.
There is a good walkthrough for configuring 1 this, including
- Enabling TCP/IP protocol for the database server
- Enabling remote connections for the database server
- Allowing the TCP traffic through the firewall
Follow this:
Start -> Programs -> Microsoft 4 SQL Server 2008 -> Configuration Tools -> SQL 3 Server Configuration Manager
SQL Server network 2 Configuration -> Protocols for [SQLInstanceName]
Right 1 click TCP/IP -> Enable
If TCP/IP is already enabled then it sounds 4 like your firewall is blocking the connection. Open 3 the relevant ports and it should work.
You 2 should check the firewall on both ends of 1 the connection.
To connect to MSSQL(SQL Server) with "TCP/IP", you need to enable 6 "TCP/IP" with SQL Server Configuration Manager(SSCM). This is How to find SQL Server Configuration Manager(SSCM) in your Windows Machine.
So, on SSCM, enable "TCP/IP" from "SQL Server Network Configuration/Protocols for SQLEXPRESS" as 5 shown below. *"TCP/IP" for MSSQL is disabled by default:
After 4 clicking on "Enable" as shown above, you will get 3 the message below:
So, as the message above 2 says, restart SQL Server(SQLEXPRESS) from "SQL Server Services" as shown below:
Finally, you 1 can connect to MSSQL with "TCP/IP".
More Related questions
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.