Which protocols are used when connecting using SQLClient if none are specified?

Discussion in 'ASP .Net' started by JimLad, Nov 13, 2007.

  1. JimLad

    JimLad Guest

    Hi,

    <add name="ConnectionString"
    connectionString="Data Source=xyz;Initial Catalog=xyz;Persist Security
    Info=True;User ID=xyz;Password=xyz"
    providerName="System.Data.SqlClient"/>

    We are having connectivity problems between the IIS web server and the
    db server. There is a firewall in between them.

    SQL Server 2000 is listening on 1433 and only TCP/IP is enabled. The
    error message mentions named pipes:

    Exception type: SqlException
    Exception message: 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)

    ASP.NET is running under NETWORK SERVICE.

    I'm pretty sure it's not a problem with the connectionstring, but can
    anyone see anything wrong here? Also which protocols does the
    System.Data.SqlClient provider use by default and in which order they
    are tried?

    Cheers,

    James
    JimLad, Nov 13, 2007
    #1
    1. Advertising

  2. JimLad

    LVP Guest

    It looks like the problem is on your SQL server side.
    Under the properties window select Connections and make sure that
    "Allow remote connections to this server" is checked.
    that might help



    "JimLad" <> wrote in message
    news:...
    > Hi,
    >
    > <add name="ConnectionString"
    > connectionString="Data Source=xyz;Initial Catalog=xyz;Persist Security
    > Info=True;User ID=xyz;Password=xyz"
    > providerName="System.Data.SqlClient"/>
    >
    > We are having connectivity problems between the IIS web server and the
    > db server. There is a firewall in between them.
    >
    > SQL Server 2000 is listening on 1433 and only TCP/IP is enabled. The
    > error message mentions named pipes:
    >
    > Exception type: SqlException
    > Exception message: 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)
    >
    > ASP.NET is running under NETWORK SERVICE.
    >
    > I'm pretty sure it's not a problem with the connectionstring, but can
    > anyone see anything wrong here? Also which protocols does the
    > System.Data.SqlClient provider use by default and in which order they
    > are tried?
    >
    > Cheers,
    >
    > James
    >
    LVP, Nov 13, 2007
    #2
    1. Advertising

  3. JimLad

    sloan Guest

    You can define and force the connection to use tcp/ip (dbmssocn) via the
    connection string:

    http://www.connectionstrings.com/article.aspx?article=howtodefinewichnetworkprotocoltouse

    Also:
    Go here
    http://www.connectionstrings.com/?carrier=sqlserver2005
    search for "1433" and it'll show you how to specify the port number.

    ........

    As already mentioned, in 2005 you explicitly have to setup Sql Server
    Configuration Tool to allow remote connections.
    Its turned off as the default.




    "JimLad" <> wrote in message
    news:...
    > Hi,
    >
    > <add name="ConnectionString"
    > connectionString="Data Source=xyz;Initial Catalog=xyz;Persist Security
    > Info=True;User ID=xyz;Password=xyz"
    > providerName="System.Data.SqlClient"/>
    >
    > We are having connectivity problems between the IIS web server and the
    > db server. There is a firewall in between them.
    >
    > SQL Server 2000 is listening on 1433 and only TCP/IP is enabled. The
    > error message mentions named pipes:
    >
    > Exception type: SqlException
    > Exception message: 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)
    >
    > ASP.NET is running under NETWORK SERVICE.
    >
    > I'm pretty sure it's not a problem with the connectionstring, but can
    > anyone see anything wrong here? Also which protocols does the
    > System.Data.SqlClient provider use by default and in which order they
    > are tried?
    >
    > Cheers,
    >
    > James
    >
    sloan, Nov 13, 2007
    #3
  4. JimLad

    JimLad Guest

    On Nov 13, 6:21 pm, "sloan" <> wrote:
    > You can define and force the connection to use tcp/ip (dbmssocn) via the
    > connection string:
    >
    > http://www.connectionstrings.com/article.aspx?article=howtodefinewich...
    >
    > Also:
    > Go herehttp://www.connectionstrings.com/?carrier=sqlserver2005
    > search for "1433" and it'll show you how to specify the port number.
    >
    > .......
    >
    > As already mentioned, in 2005 you explicitly have to setup Sql Server
    > Configuration Tool to allow remote connections.
    > Its turned off as the default.
    >
    > "JimLad" <> wrote in message
    >
    > news:...
    >
    >
    >
    > > Hi,

    >
    > > <add name="ConnectionString"
    > > connectionString="Data Source=xyz;Initial Catalog=xyz;Persist Security
    > > Info=True;User ID=xyz;Password=xyz"
    > > providerName="System.Data.SqlClient"/>

    >
    > > We are having connectivity problems between the IIS web server and the
    > > db server. There is a firewall in between them.

    >
    > > SQL Server 2000 is listening on 1433 and only TCP/IP is enabled. The
    > > error message mentions named pipes:

    >
    > > Exception type: SqlException
    > > Exception message: 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)

    >
    > > ASP.NET is running under NETWORK SERVICE.

    >
    > > I'm pretty sure it's not a problem with the connectionstring, but can
    > > anyone see anything wrong here? Also which protocols does the
    > > System.Data.SqlClient provider use by default and in which order they
    > > are tried?

    >
    > > Cheers,

    >
    > > James- Hide quoted text -

    >
    > - Show quoted text -


    Hi guys,

    Thanks for that. I did mention that I'm using SQL Server 2000, and I
    think that makes quite a lot of difference. Remote connections
    certainly aren't disabled. And I really want to know what protocols it
    uses by default.

    I believe I can also select tcp/ip by prefixing tcp: in the data
    source. You mentioned Network Library=DBMSSOCN. Which is better?

    Cheers,

    James
    JimLad, Nov 14, 2007
    #4
  5. JimLad

    JimLad Guest

    On Nov 14, 9:41 am, JimLad <> wrote:
    > On Nov 13, 6:21 pm, "sloan" <> wrote:
    >
    >
    >
    >
    >
    > > You can define and force the connection to use tcp/ip (dbmssocn) via the
    > > connection string:

    >
    > >http://www.connectionstrings.com/article.aspx?article=howtodefinewich...

    >
    > > Also:
    > > Go herehttp://www.connectionstrings.com/?carrier=sqlserver2005
    > > search for "1433" and it'll show you how to specify the port number.

    >
    > > .......

    >
    > > As already mentioned, in 2005 you explicitly have to setup Sql Server
    > > Configuration Tool to allow remote connections.
    > > Its turned off as the default.

    >
    > > "JimLad" <> wrote in message

    >
    > >news:...

    >
    > > > Hi,

    >
    > > > <add name="ConnectionString"
    > > > connectionString="Data Source=xyz;Initial Catalog=xyz;Persist Security
    > > > Info=True;User ID=xyz;Password=xyz"
    > > > providerName="System.Data.SqlClient"/>

    >
    > > > We are having connectivity problems between the IIS web server and the
    > > > db server. There is a firewall in between them.

    >
    > > > SQL Server 2000 is listening on 1433 and only TCP/IP is enabled. The
    > > > error message mentions named pipes:

    >
    > > > Exception type: SqlException
    > > > Exception message: 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)

    >
    > > > ASP.NET is running under NETWORK SERVICE.

    >
    > > > I'm pretty sure it's not a problem with the connectionstring, but can
    > > > anyone see anything wrong here? Also which protocols does the
    > > > System.Data.SqlClient provider use by default and in which order they
    > > > are tried?

    >
    > > > Cheers,

    >
    > > > James- Hide quoted text -

    >
    > > - Show quoted text -

    >
    > Hi guys,
    >
    > Thanks for that. I did mention that I'm using SQL Server 2000, and I
    > think that makes quite a lot of difference. Remote connections
    > certainly aren't disabled. And I really want to know what protocols it
    > uses by default.
    >
    > I believe I can also select tcp/ip by prefixing tcp: in the data
    > source. You mentioned Network Library=DBMSSOCN. Which is better?
    >
    > Cheers,
    >
    > James- Hide quoted text -
    >
    > - Show quoted text -


    I have now specified tcp/ip and port 1433.

    <add name="ConnectionString"
    connectionString="Data Source=tcp:xyz,1433;Initial Catalog=xyz;Persist
    Security
    Info=True;User ID=xyz;Password=xyz"
    providerName="System.Data.SqlClient"/>

    I now get the following error:
    provider: TCP Provider, error: 0 - A connection attempt failed because
    the connected party did not properly respond after a period of time,
    or established connection failed because connected host has failed to
    respond.

    The db server is deliberately not pingable from the web server. Will
    that be causing the problem?

    James
    JimLad, Nov 14, 2007
    #5
  6. JimLad

    sloan Guest

    A: I'd stick with the dbmssocn syntax. Just my hunch.

    B. Try putting in the IP address (100.100.100.100 'ish style)...if you've
    deliberately turned off the ping-ability of the machine.

    I don't know the answer to that one, I've never done something like that
    before. But maybe you've answered your own question.

    Even with 2000, most (if not all) of the connectionstrings.com values are
    legit.

    ...

    Try the IP address with the dbmssocn syntax...(by specifying the IP address,
    the port number, and the network protocol ...that's just about as specific
    as you can get)


    If that doesn't work , sounds like the pingablilty disabling might be your
    culprit.

    "JimLad" <> wrote in message
    news:...
    > On Nov 14, 9:41 am, JimLad <> wrote:
    >> On Nov 13, 6:21 pm, "sloan" <> wrote:
    >>
    >>
    >>
    >>
    >>
    >> > You can define and force the connection to use tcp/ip (dbmssocn) via
    >> > the
    >> > connection string:

    >>
    >> >http://www.connectionstrings.com/article.aspx?article=howtodefinewich...

    >>
    >> > Also:
    >> > Go herehttp://www.connectionstrings.com/?carrier=sqlserver2005
    >> > search for "1433" and it'll show you how to specify the port number.

    >>
    >> > .......

    >>
    >> > As already mentioned, in 2005 you explicitly have to setup Sql Server
    >> > Configuration Tool to allow remote connections.
    >> > Its turned off as the default.

    >>
    >> > "JimLad" <> wrote in message

    >>
    >> >news:...

    >>
    >> > > Hi,

    >>
    >> > > <add name="ConnectionString"
    >> > > connectionString="Data Source=xyz;Initial Catalog=xyz;Persist
    >> > > Security
    >> > > Info=True;User ID=xyz;Password=xyz"
    >> > > providerName="System.Data.SqlClient"/>

    >>
    >> > > We are having connectivity problems between the IIS web server and
    >> > > the
    >> > > db server. There is a firewall in between them.

    >>
    >> > > SQL Server 2000 is listening on 1433 and only TCP/IP is enabled. The
    >> > > error message mentions named pipes:

    >>
    >> > > Exception type: SqlException
    >> > > Exception message: 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)

    >>
    >> > > ASP.NET is running under NETWORK SERVICE.

    >>
    >> > > I'm pretty sure it's not a problem with the connectionstring, but can
    >> > > anyone see anything wrong here? Also which protocols does the
    >> > > System.Data.SqlClient provider use by default and in which order they
    >> > > are tried?

    >>
    >> > > Cheers,

    >>
    >> > > James- Hide quoted text -

    >>
    >> > - Show quoted text -

    >>
    >> Hi guys,
    >>
    >> Thanks for that. I did mention that I'm using SQL Server 2000, and I
    >> think that makes quite a lot of difference. Remote connections
    >> certainly aren't disabled. And I really want to know what protocols it
    >> uses by default.
    >>
    >> I believe I can also select tcp/ip by prefixing tcp: in the data
    >> source. You mentioned Network Library=DBMSSOCN. Which is better?
    >>
    >> Cheers,
    >>
    >> James- Hide quoted text -
    >>
    >> - Show quoted text -

    >
    > I have now specified tcp/ip and port 1433.
    >
    > <add name="ConnectionString"
    > connectionString="Data Source=tcp:xyz,1433;Initial Catalog=xyz;Persist
    > Security
    > Info=True;User ID=xyz;Password=xyz"
    > providerName="System.Data.SqlClient"/>
    >
    > I now get the following error:
    > provider: TCP Provider, error: 0 - A connection attempt failed because
    > the connected party did not properly respond after a period of time,
    > or established connection failed because connected host has failed to
    > respond.
    >
    > The db server is deliberately not pingable from the web server. Will
    > that be causing the problem?
    >
    > James
    >
    sloan, Nov 14, 2007
    #6
  7. JimLad

    JimLad Guest

    Re: Which protocols are used when connecting using SQLClient if noneare specified?

    On Nov 14, 3:14 pm, "sloan" <> wrote:
    > A: I'd stick with the dbmssocn syntax. Just my hunch.
    >
    > B. Try putting in the IP address (100.100.100.100 'ish style)...if you've
    > deliberately turned off the ping-ability of the machine.
    >
    > I don't know the answer to that one, I've never done something like that
    > before. But maybe you've answered your own question.
    >
    > Even with 2000, most (if not all) of the connectionstrings.com values are
    > legit.
    >
    > ..
    >
    > Try the IP address with the dbmssocn syntax...(by specifying the IP address,
    > the port number, and the network protocol ...that's just about as specific
    > as you can get)
    >
    > If that doesn't work , sounds like the pingablilty disabling might be your
    > culprit.
    >
    > "JimLad" <> wrote in message
    >
    > news:...
    >
    >
    >
    > > On Nov 14, 9:41 am, JimLad <> wrote:
    > >> On Nov 13, 6:21 pm, "sloan" <> wrote:

    >
    > >> > You can define and force the connection to use tcp/ip (dbmssocn) via
    > >> > the
    > >> > connection string:

    >
    > >> >http://www.connectionstrings.com/article.aspx?article=howtodefinewich...

    >
    > >> > Also:
    > >> > Go herehttp://www.connectionstrings.com/?carrier=sqlserver2005
    > >> > search for "1433" and it'll show you how to specify the port number.

    >
    > >> > .......

    >
    > >> > As already mentioned, in 2005 you explicitly have to setup Sql Server
    > >> > Configuration Tool to allow remote connections.
    > >> > Its turned off as the default.

    >
    > >> > "JimLad" <> wrote in message

    >
    > >> >news:...

    >
    > >> > > Hi,

    >
    > >> > > <add name="ConnectionString"
    > >> > > connectionString="Data Source=xyz;Initial Catalog=xyz;Persist
    > >> > > Security
    > >> > > Info=True;User ID=xyz;Password=xyz"
    > >> > > providerName="System.Data.SqlClient"/>

    >
    > >> > > We are having connectivity problems between the IIS web server and
    > >> > > the
    > >> > > db server. There is a firewall in between them.

    >
    > >> > > SQL Server 2000 is listening on 1433 and only TCP/IP is enabled. The
    > >> > > error message mentions named pipes:

    >
    > >> > > Exception type: SqlException
    > >> > > Exception message: 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)

    >
    > >> > > ASP.NET is running under NETWORK SERVICE.

    >
    > >> > > I'm pretty sure it's not a problem with the connectionstring, but can
    > >> > > anyone see anything wrong here? Also which protocols does the
    > >> > > System.Data.SqlClient provider use by default and in which order they
    > >> > > are tried?

    >
    > >> > > Cheers,

    >
    > >> > > James- Hide quoted text -

    >
    > >> > - Show quoted text -

    >
    > >> Hi guys,

    >
    > >> Thanks for that. I did mention that I'm using SQL Server 2000, and I
    > >> think that makes quite a lot of difference. Remote connections
    > >> certainly aren't disabled. And I really want to know what protocols it
    > >> uses by default.

    >
    > >> I believe I can also select tcp/ip by prefixing tcp: in the data
    > >> source. You mentioned Network Library=DBMSSOCN. Which is better?

    >
    > >> Cheers,

    >
    > >> James- Hide quoted text -

    >
    > >> - Show quoted text -

    >
    > > I have now specified tcp/ip and port 1433.

    >
    > > <add name="ConnectionString"
    > > connectionString="Data Source=tcp:xyz,1433;Initial Catalog=xyz;Persist
    > > Security
    > > Info=True;User ID=xyz;Password=xyz"
    > > providerName="System.Data.SqlClient"/>

    >
    > > I now get the following error:
    > > provider: TCP Provider, error: 0 - A connection attempt failed because
    > > the connected party did not properly respond after a period of time,
    > > or established connection failed because connected host has failed to
    > > respond.

    >
    > > The db server is deliberately not pingable from the web server. Will
    > > that be causing the problem?

    >
    > > James- Hide quoted text -

    >
    > - Show quoted text -


    The problem wasn't the connection string it was the fact that ping
    wasn't working. Our systems guys couldn't fathom why.
    So we gave up and we used a different db server that was pingable. I
    specified protocol and port in the end although it wasn't really
    necessary.
    JimLad, Nov 20, 2007
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. yamadora1999
    Replies:
    2
    Views:
    472
    yamadora1999
    May 25, 2005
  2. length power
    Replies:
    2
    Views:
    69
    Rustom Mody
    Apr 10, 2014
  3. Skip Montanaro
    Replies:
    0
    Views:
    51
    Skip Montanaro
    Apr 10, 2014
  4. Johannes Schneider

    Re: why i have the output of [None, None, None]

    Johannes Schneider, Apr 10, 2014, in forum: Python
    Replies:
    0
    Views:
    46
    Johannes Schneider
    Apr 10, 2014
  5. Terry Reedy
    Replies:
    0
    Views:
    55
    Terry Reedy
    Apr 10, 2014
Loading...

Share This Page