locked
Connection problem RRS feed

  • Question

  • Hello everybody

    I am using Vitual Studio 2008 and SQL Server 2005 SQL Server with Management Studio Express. Besides the OS is Windows 7.

    My connection code is simple

    public string ConnectionString()
    
      {
    
       // Please Change the server location here.
    
       //192.168.50.101
    
    
       string connString = @"
    
        server = Server-Name\SQLEXPRESS;
    
        integrated security = true;
    
        database = MonitoringSQL2010
    
        ";
    
       return connString;
    
      }
    
    

    It works fine But the problem is when I want to change the server into ip address, It can not connect and does not find the server. The error is "The server was not found or was not accessible. Verify the instance name is correct and the sql server is configured to allow remote connection.(provider: Named Pipes Provide, error: 40- Could not open connection)"

    I have configured the SQL server surface area configuration. But still no change. Is there anyone face this finda problem.

    Please advice. Thanks

    Sunday, August 1, 2010 9:54 AM

Answers

  • The SQL Server Surface Area configuration is for incoming connection, on the serveur side.  This doesn't mean that on the client side, a client trying to connect to the (remote-) SQL-Server will necessarily try the TCP/IP protocol.

    Try adding the tcp: prefix just before the server name.  If this doesn't work, try creating an alias and use it instead.  With an Alias, you can specify the protocol to be used.  From the error message that you have shown us, it's clear that's the named pipe protocol that the client is using when trying to connect to the remote serveur.

    Also, make sure that you don't have a firewall connection problem.

    Also, as you are using a named instance, the SQL-Server Browing must be up and running on the server side (and the port 1434 must be opened on the firewall) in order to dynamically allocate a port instead of the default port 1433 (which is reserved for an unnamed instance).


    Sylvain Lafontaine, ing.
    MVP - Access
    Blog/web site: http://coding-paparazzi.sylvainlafontaine.com
    Independent consultant and remote programming for Access and SQL-Server (French)

    <Soulidentities> wrote in message news:49a3aaf1-dfe0-487e-ab71-3e450609a82c@communitybridge.codeplex.com...

    Hello everybody

    I am using Vitual Studio 2008 and SQL Server 2005 SQL Server with Management Studio Express. Besides the OS is Windows 7.
    My connection code is simple

    public string ConnectionString()
    
     {
    
      // Please Change the server location here.
    
      //192.168.50.101
    
      string connString = @"
    
       server = Server-Name\SQLEXPRESS;
    
       integrated security = true;
    
       database = MonitoringSQL2010
    
       ";
    
      return connString;
    
     }
    
    

    It works fine But the problem is when I want to change the server into ip address, It can not connect and does not find the server. The error is "The server was not found or was not accessible. Verify the instance name is correct and the sql server is configured to allow remote connection.(provider: Named Pipes Provide, error: 40- Could not open connection)"
    I have configured the SQL server surface area configuration. But still no change. Is there anyone face this finda problem.
    Please advice. Thanks

    • Marked as answer by Tom Li - MSFT Tuesday, September 7, 2010 7:28 AM
    Monday, August 2, 2010 12:26 AM

All replies

  • When you are using the IP Address, I hope your Server string looks like IPADDRESS\SQLEXPRESS. If you omit the instance name enter only the IP Address you will get an error message.
    Pradeep Adiga
    My blog: http://www.sqldbadiaries.com
    • Proposed as answer by Tom Li - MSFT Tuesday, August 3, 2010 11:45 AM
    Sunday, August 1, 2010 10:57 AM
  • The SQL Server Surface Area configuration is for incoming connection, on the serveur side.  This doesn't mean that on the client side, a client trying to connect to the (remote-) SQL-Server will necessarily try the TCP/IP protocol.

    Try adding the tcp: prefix just before the server name.  If this doesn't work, try creating an alias and use it instead.  With an Alias, you can specify the protocol to be used.  From the error message that you have shown us, it's clear that's the named pipe protocol that the client is using when trying to connect to the remote serveur.

    Also, make sure that you don't have a firewall connection problem.

    Also, as you are using a named instance, the SQL-Server Browing must be up and running on the server side (and the port 1434 must be opened on the firewall) in order to dynamically allocate a port instead of the default port 1433 (which is reserved for an unnamed instance).


    Sylvain Lafontaine, ing.
    MVP - Access
    Blog/web site: http://coding-paparazzi.sylvainlafontaine.com
    Independent consultant and remote programming for Access and SQL-Server (French)

    <Soulidentities> wrote in message news:49a3aaf1-dfe0-487e-ab71-3e450609a82c@communitybridge.codeplex.com...

    Hello everybody

    I am using Vitual Studio 2008 and SQL Server 2005 SQL Server with Management Studio Express. Besides the OS is Windows 7.
    My connection code is simple

    public string ConnectionString()
    
     {
    
      // Please Change the server location here.
    
      //192.168.50.101
    
      string connString = @"
    
       server = Server-Name\SQLEXPRESS;
    
       integrated security = true;
    
       database = MonitoringSQL2010
    
       ";
    
      return connString;
    
     }
    
    

    It works fine But the problem is when I want to change the server into ip address, It can not connect and does not find the server. The error is "The server was not found or was not accessible. Verify the instance name is correct and the sql server is configured to allow remote connection.(provider: Named Pipes Provide, error: 40- Could not open connection)"
    I have configured the SQL server surface area configuration. But still no change. Is there anyone face this finda problem.
    Please advice. Thanks

    • Marked as answer by Tom Li - MSFT Tuesday, September 7, 2010 7:28 AM
    Monday, August 2, 2010 12:26 AM