Unable to connect to SQL 2005

  • Hello,

    We are using the following from a app server to try and connect to a SQL 2005 server: System.Data.SqlClient.SqlConnection

    The connection string looks like the following:

    "Persist Security Info=False;User ID=test;Password=test-123;Initial Catalog=testsb;Data Source=SQLDevDbTest01 "< ?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

    We get the following message:

    System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

    Any ideas?

     

  • You need to open the surface area configuration tool and click the option for remote connections and then click local and remote connections option. Use bol 2005 for more dtails 

  • Sorry - I should have included in my post that I already did that. The server is configured to allow Local and Remote connections over TCP/IP and named pipes.

  • have you restarted the service?

  • Yes;manually restarted each service as well as bounced the server.

  • Can you ping the server? Have you tried specifying IP-address instead of server name? Can you connect using TCP/IP? Is the server installed as default instance?

  • I was playing this morning with a SQL 2005 instance and I'd stopped the "SQL Service Broker" service and couldn't connect from my PC with a similar message.

    A long shot, and it assumes the server is healthy and SQL is running

    Cheers

  • Q: Can you ping the server?
    A: Yes
     
    Q: Have you tried specifying IP-address instead of server name?
    A: Yes
     
    Q: Can you connect using TCP/IP?
    A: Yes (tried w/query analyzer)
     
    Q: Is the server installed as default instance?
    A: Yes
     
     
     
     
  • I did not install service broker as part of the setup. I have not read anywhere where it is required to connect to the server from a client. Are you sayin it is needed?

     

  • Q: Have you tried specifying IP-address instead of server name?
    A: Sorry - thought we had tried it but had not. My developer just tried connecting his app via ip instead of by server name and it works. Any thoughts on why connecting by name would not work?
  • When I experience similar problems I usually try to made an entry in the hosts file

    C:\WINDOWS\system32\drivers\etc\hosts and lmhosts


    Cheers,

    david russell

Viewing 11 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic. Login to reply