Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2008
    Posts
    186

    Unanswered: Remote connections to SQL server

    I wrote a small app to connect and read data from my SQL Server express database.

    Everything works fine on the local machine, however I get the following exception when I try it from a remote machine:

    Unhandled Exception: 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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

    What do I need to do within the Management Studio IDE to allow my server to accept remote connections?

    Thanks

  2. #2
    Join Date
    Jan 2008
    Posts
    186
    Here's what I've tried:

    1) Right-click on your server in the IDE, and choose "Properties"
    2) Select "Connections" on the left side of the window
    3) Under where it says "Remote server connections" I have that box CHECKED that says "allow remote connections to this server"

    ...and yet I still get the above error message.

    Any ideas??

  3. #3
    Join Date
    Jan 2008
    Posts
    186
    Here's another thing I've tried

    1) Open up the "Surface Area Configuration" tool
    2) Choose the "configuration for services and connections" link
    3) Select "Remote connections" on the left
    4) Choose "Local and remote connections" on the right, with "Using TCP/IP only" option selected.

    5) Hit OK
    6) Go back to the management studio IDE, and restart the database server


    Still doesn't work

  4. #4
    Join Date
    Jan 2008
    Posts
    186
    Here is my connection string:

    "server=machine950\\sqlexpress;uid=testuser;pwd=te st;database=db_test"

  5. #5
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    do you have a exception in your firewall for the port you are using for SQL Server?
    If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry. Earnest Hemingway, A Farewell To Arms.

  6. #6
    Join Date
    Jan 2008
    Posts
    186
    Quote Originally Posted by Thrasymachus
    do you have a exception in your firewall for the port you are using for SQL Server?
    No, I don't have one listed.... Do I need one? The reason I ask is because I also had a MySQL server running on the box, and I didn't have any firewall exceptions for that.

  7. #7
    Join Date
    Jan 2008
    Posts
    186
    Hello. Just to let everyone know, the problem was that I needed to enable the SQL Server Browser service.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •