locked
The underlying provider failed to open RRS feed

  • Question

  • Here's my scenario.

    Using sql express I created a database on my machine.  I created a connection and am able to run a linq query.  All is good.

    I proceeded to create a copy of the database on a remote server (a named instance).  I have verified that I can connect to this new database using windows authentication and using a SQL user account within SQL management studio and I can run queries.

    I started a new project (blank win form) with visual studio 2008 and added a new ADO.net Entity Data Model.  I am able to create the connection and the 'test connection' returns successful.  I am able to add the tables to the edmx file.

    If I use the following code (which worked when using my local SQLEXPRESS db), I get a message saying provider failed to open.

    FooMyEntities db = new FooMyEntities();
                
    db.Connection.Open();



           Message="A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)"
           Source=".Net SqlClient Data Provider"

    Wednesday, March 17, 2010 6:31 PM

Answers

  • Found solution:  Apparently SQL wasn't listening correctly on the right port.  Switched it from using a dynamic port to a specified one, opened that port in the firewall and all seemed to work great.
    Wednesday, March 17, 2010 8:46 PM

All replies

  • Found solution:  Apparently SQL wasn't listening correctly on the right port.  Switched it from using a dynamic port to a specified one, opened that port in the firewall and all seemed to work great.
    Wednesday, March 17, 2010 8:46 PM
  • Found solution:  Apparently SQL wasn't listening correctly on the right port.  Switched it from using a dynamic port to a specified one, opened that port in the firewall and all seemed to work great.

    Which port did you use?
    Monday, April 9, 2012 7:35 PM
  • On 4/9/2012 3:35 PM, Brian Wolters wrote:
    >     Found solution: Apparently SQL wasn't listening correctly on the
    >     right port. Switched it from using a dynamic port to a specified
    >     one, opened that port in the firewall and all seemed to work great.
    >
    >
    > Which port did you use?
     
    Of course, opening a port on the FW for SQL server access  by an
    application is totally the wrong thing to do. That application is not
    right.
     
    Monday, April 9, 2012 9:47 PM