unable to connect to server | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

unable to connect to server

hello everybody, i’m developing a new subapplication for our software to be able to connect to and work with sql server 2005. Until now we can do so with sql server 2000. In my new project I have to provide the possibility to connect and work with both of htese servers. To test I wrote a few lines of code to get some informations of all servers available in our network. Now, I can see them all and can connect to all of the sql servers 2000, except the new sql server 2005 (-of course I allowed remote-connections)… here’s a part of my Code: ***************************************************************
‘ Recreate connection if necessary
If ServerConn Is Nothing Then
ServerConn = New ServerConnection
End If ‘ choose the server to connect to from a combobox
‘where all sdervers are listed!!!)
ServerConn.ServerInstance = ServerNamesComboBox.Text ‘ Setup capture and execute to be able to display script
ServerConn.SqlExecutionModes = SqlExecutionModes.ExecuteAndCaptureSql
ServerConn.ConnectTimeout = CType(TimeoutUpDown.Value, Int32)
If WindowsAuthenticationRadioButton.Checked = True Then
‘ Use Windows authentication
ServerConn.LoginSecure = True
Else
‘ Use SQL Server authentication
ServerConn.LoginSecure = False
ServerConn.Login = UserNameTextBox.Text
ServerConn.Password = PasswordTextBox.Text
End If ‘ Go ahead and connect
ServerConn.Connect() **********************************************************
by the way, I’m developing with Visual Studio 2005… I really cannot imagine why it is not working with the new server and hope someone here can help me… Thanks a lot and have a nice evening,
Sandra
Hi,
What Error do you get when ServerConn.Connect() gets Executed?
Also Which Provider name You have specified.
Hi,<br /><br />here’s the error-message I get:<br /><br />"Microsoft.SqlServer.ConnectionInfo:<br /><br />Error while connecting to server ‘xxx’.<br /><br />(provider: Named Pipes-Provider, error: 40 – Connection to SQL Server failed) <br />(Microsoft SQL Server, error: 53)<br /><br />For help click here:<a target="_blank" href=http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=53&LinkId=20476>http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=53&LinkId=20476</a> " <br />-&gt; but if you click there, you just get a message that there is no information on this error! (GREAT!!! I love Microsoft… [<img src=’/community/emoticons/emotion-5.gif’ alt=’;)‘ />])<br /><br />!!! WARNING !!! The text above is my own translation because I just get german messages…<br /><br />I hope this helps you identifying my problem…<br />Anyway, have a nice day and thanks for your help!<br />SanDee
hi, (a) is this sql server 2005 a named instance ?
(b) Is firewall enabled on this server, if yes then; is that port excempted ?
(c) is sql browser service enabled ? if no; you should mention the port number in connection string Ref:
http://madhuottapalam.blogspot.com/2007/01/sql-browser-service-in-sql-2005.html
Madhu
Hello Madhu and Ranjitjain, Problem solved. Madhu, you were right… The Windows Firewall was activated. This must have happened automatically and without notification during the installation of SQL Server 2005!!! Because usually Windows Firewall is set inactive on all of our computers… So thanks a lot everybody and enjoy your day! Greetings from the Black Forest / Germany,
SanDee
]]>