views:

140

answers:

6

I get the following error when I try to connect with TCP/IP from SQL Server Management Studio. I want a step by step description to solve my problem I don`t know what´s wrong?

Cannot connect to 
===================================

A network related or instance specific error when a connection to SQL Server...
(provider: Named pipe-provider, error: 40 -  SQL Server)
(.Net SqlClient Data Provider)

------------------------------
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=53&LinkId=20476

------------------------------
Error Number: 53
Severity: 20
State: 0

------------------------------
Program Location:

   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject)
   at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)
   at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
   at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
   at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
   at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
   at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
   at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
   at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
   at System.Data.SqlClient.SqlConnection.Open()
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ObjectExplorer.ValidateConnection(UIConnectionInfo ci, IServerType server)
   at Microsoft.SqlServer.Management.UI.ConnectionDlg.Connector.ConnectionThreadUser()
+1  A: 

Have a look at www.connectionstrings.com. Error message looks like you're using named pipes and not tcp/ip. Don't forget you must enasble TCP/IP on server machines for SQL Server explicitly.

Sascha
Thanks..but I´m using a tcp/ip number
MCOL
If you setup your server to not use the default port, you might want to add an alias or state the port explicitly. This should be on the posted URL as an example. Besides that, firewall and the given comments on the connection string should lead to a solution.
Sascha
+1  A: 

Are you 200% sure your server is setup to accept connections via TCP/IP?

CResults
Yes I am sure.....
MCOL
On the server you are trying to connect to, run SQL Server Configuration Manager, network configuration, check TCP/IP is enabled (in relation to above). Also check the list of IP address (by double clicking) to make sure you're trying to connect to one of them.
CResults
A: 

When you check the SQL Server Network Configuration (Start Menu > Microsoft SQL Server > Configuration Tools > SQL Server Configuration Manager > SQL Server Network Configuration), what do you see?

alt text

Is the TCP/IP protocol really enabled on your server? It's off by default, and stays off in most cases (unless you specifically turn it on).

Just using a IP-based server address doesn't mean you're connecting using the TCP/IP protocol.... check http://www.connectionstrings.com/sql-server-2008 for a sample connection 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 tells your code to connect using TCP/IP.

marc_s
TCP/IP is enabled...
MCOL
on the server and the client side?? What's the sequence of the protocols on the client side? Unless you explicitly specify which one to use, the SQL Server client will pick the first enabled one in the list. That's under the "SQL Native Client Configuration"
marc_s
A: 

Follow this:

Start -> Programs -> Microsoft SQL Server 2008 -> Configuration Tools -> SQL Server Configuration Manager

SQL Server network Configuration -> Protocols for [SQLInstanceName]

Right click TCP/IP -> Enable

ck
Done..but it doesn´t work.....
MCOL
A: 

If TCP/IP is already enabled then it sounds like your firewall is blocking the connection. Open the relevant ports and it should work.

You should check the firewall on both ends of the connection.

Simon
A: 

It doesn't worked for me too. "Login failed for user PCname/Guest" is the error I got.

sml