Error "SQL Server does not allow remote connections"

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Cirene

    Error "SQL Server does not allow remote connections"

    I just deployed my new ASP.NET (3.5 FW) site to the hosting company I'm
    using, webhost4life.

    NOTE: I HAVE deployed other SQL Server sites to the same account with no
    issues.

    Now I'm getting this error. Any idea why?

    Server Error in '/myuser4/MyWebApp' Application.
    --------------------------------------------------------------------------------

    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)
    Description: An unhandled exception occurred during the execution of the
    current web request. Please review the stack trace for more information
    about the error and where it originated in the code.

    Exception Details: System.Data.Sql Client.SqlExcep tion: 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)

    Source Error:


    Line 4:
    Line 5: Protected Sub Page_Load(ByVal sender As Object, ByVal e As
    System.EventArg s) Handles Me.Load
    Line 6: If User.IsInRole(" LexAdmin") Or
    User.IsInRole(" LexOperator") Or User.IsInRole(" LexUser") Then
    Line 7: Response.Redire ct("admin/ManagePackages. aspx")
    Line 8: ElseIf User.IsInRole(" CustomerAdmin") Or
    User.IsInRole(" CustomerClient" ) Or User.IsInRole(" CustomerUser") Then


    Source File: d:\hosting\memb er\myuser4\MyWe bApp\loginredir ect.aspx.vb
    Line: 6

    Stack Trace:


    [SqlException (0x80131904): 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)]
    System.Data.Sql Client.SqlInter nalConnection.O nError(SqlExcep tion
    exception, Boolean breakConnection ) +800131
    System.Data.Sql Client.TdsParse r.ThrowExceptio nAndWarning(Tds ParserStateObje ct
    stateObj) +186
    System.Data.Sql Client.TdsParse r.Connect(Serve rInfo serverInfo,
    SqlInternalConn ectionTds connHandler, Boolean ignoreSniOpenTi meout, Int64
    timerExpire, Boolean encrypt, Boolean trustServerCert , Boolean
    integratedSecur ity, SqlConnection owningObject) +737554
    System.Data.Sql Client.SqlInter nalConnectionTd s.AttemptOneLog in(ServerInfo
    serverInfo, String newPassword, Boolean ignoreSniOpenTi meout, Int64
    timerExpire, SqlConnection owningObject) +114
    System.Data.Sql Client.SqlInter nalConnectionTd s.LoginNoFailov er(String
    host, String newPassword, Boolean redirectedUserI nstance, SqlConnection
    owningObject, SqlConnectionSt ring connectionOptio ns, Int64 timerStart) +381
    System.Data.Sql Client.SqlInter nalConnectionTd s.OpenLoginEnli st(SqlConnectio n
    owningObject, SqlConnectionSt ring connectionOptio ns, String newPassword,
    Boolean redirectedUserI nstance) +181
    System.Data.Sql Client.SqlInter nalConnectionTd s..ctor(DbConne ctionPoolIdenti ty
    identity, SqlConnectionSt ring connectionOptio ns, Object providerInfo, String
    newPassword, SqlConnection owningObject, Boolean redirectedUserI nstance)
    +173
    System.Data.Sql Client.SqlConne ctionFactory.Cr eateConnection( DbConnectionOpt ions
    options, Object poolGroupProvid erInfo, DbConnectionPoo l pool, DbConnection
    owningConnectio n) +133
    System.Data.Pro viderBase.DbCon nectionFactory. CreatePooledCon nection(DbConne ction
    owningConnectio n, DbConnectionPoo l pool, DbConnectionOpt ions options) +30
    System.Data.Pro viderBase.DbCon nectionPool.Cre ateObject(DbCon nection
    owningObject) +424
    System.Data.Pro viderBase.DbCon nectionPool.Use rCreateRequest( DbConnection
    owningObject) +66
    System.Data.Pro viderBase.DbCon nectionPool.Get Connection(DbCo nnection
    owningObject) +494
    System.Data.Pro viderBase.DbCon nectionFactory. GetConnection(D bConnection
    owningConnectio n) +82
    System.Data.Pro viderBase.DbCon nectionClosed.O penConnection(D bConnection
    outerConnection , DbConnectionFac tory connectionFacto ry) +105
    System.Data.Sql Client.SqlConne ction.Open() +111
    System.Web.Data Access.SqlConne ctionHolder.Ope n(HttpContext context,
    Boolean revertImpersona te) +84
    System.Web.Data Access.SqlConne ctionHelper.Get Connection(Stri ng
    connectionStrin g, Boolean revertImpersona tion) +197
    System.Web.Secu rity.SqlRolePro vider.GetRolesF orUser(String username) +771
    System.Web.Secu rity.RolePrinci pal.IsInRole(St ring role) +272
    loginredirect.P age_Load(Object sender, EventArgs e) in
    d:\hosting\memb er\myuser4\MyWe bApp\loginredir ect.aspx.vb:6
    System.Web.UI.C ontrol.OnLoad(E ventArgs e) +99
    System.Web.UI.C ontrol.LoadRecu rsive() +47
    System.Web.UI.P age.ProcessRequ estMain(Boolean
    includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint) +1436




    --------------------------------------------------------------------------------
    Version Information: Microsoft .NET Framework Version:2.0.507 27.1433;
    ASP.NET Version:2.0.507 27.1433


  • Teemu Keiski

    #2
    Re: Error "SQL Server does not allow remote connections&quo t;

    By default SQl2005 does not accept remote connections e.g when they are made
    with remote IP (not with local IP address). E.g first check that you have
    correct IP.

    This remote connection allowing is configured with SQL Server's Surface
    Area configuration tool (there are selections Local connections Only/Local
    and remote connections). In case this isn't something you can control, I
    suggest you contact your host

    --
    Teemu Keiski
    ASP.NET MVP, AspInsider
    Finland, EU




    "Cirene" <cirene@nowhere .comwrote in message
    news:%23TMdOpQv IHA.1240@TK2MSF TNGP02.phx.gbl. ..
    >I just deployed my new ASP.NET (3.5 FW) site to the hosting company I'm
    >using, webhost4life.
    >
    NOTE: I HAVE deployed other SQL Server sites to the same account with no
    issues.
    >
    Now I'm getting this error. Any idea why?
    >
    Server Error in '/myuser4/MyWebApp' Application.
    --------------------------------------------------------------------------------
    >
    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)
    Description: An unhandled exception occurred during the execution of the
    current web request. Please review the stack trace for more information
    about the error and where it originated in the code.
    >
    Exception Details: System.Data.Sql Client.SqlExcep tion: 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)
    >
    Source Error:
    >
    >
    Line 4:
    Line 5: Protected Sub Page_Load(ByVal sender As Object, ByVal e As
    System.EventArg s) Handles Me.Load
    Line 6: If User.IsInRole(" LexAdmin") Or
    User.IsInRole(" LexOperator") Or User.IsInRole(" LexUser") Then
    Line 7: Response.Redire ct("admin/ManagePackages. aspx")
    Line 8: ElseIf User.IsInRole(" CustomerAdmin") Or
    User.IsInRole(" CustomerClient" ) Or User.IsInRole(" CustomerUser") Then
    >
    >
    Source File: d:\hosting\memb er\myuser4\MyWe bApp\loginredir ect.aspx.vb
    Line: 6
    >
    Stack Trace:
    >
    >
    [SqlException (0x80131904): 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)]
    System.Data.Sql Client.SqlInter nalConnection.O nError(SqlExcep tion
    exception, Boolean breakConnection ) +800131
    >
    System.Data.Sql Client.TdsParse r.ThrowExceptio nAndWarning(Tds ParserStateObje ct
    stateObj) +186
    System.Data.Sql Client.TdsParse r.Connect(Serve rInfo serverInfo,
    SqlInternalConn ectionTds connHandler, Boolean ignoreSniOpenTi meout, Int64
    timerExpire, Boolean encrypt, Boolean trustServerCert , Boolean
    integratedSecur ity, SqlConnection owningObject) +737554
    >
    System.Data.Sql Client.SqlInter nalConnectionTd s.AttemptOneLog in(ServerInfo
    serverInfo, String newPassword, Boolean ignoreSniOpenTi meout, Int64
    timerExpire, SqlConnection owningObject) +114
    System.Data.Sql Client.SqlInter nalConnectionTd s.LoginNoFailov er(String
    host, String newPassword, Boolean redirectedUserI nstance, SqlConnection
    owningObject, SqlConnectionSt ring connectionOptio ns, Int64 timerStart)
    +381
    >
    System.Data.Sql Client.SqlInter nalConnectionTd s.OpenLoginEnli st(SqlConnectio n
    owningObject, SqlConnectionSt ring connectionOptio ns, String newPassword,
    Boolean redirectedUserI nstance) +181
    >
    System.Data.Sql Client.SqlInter nalConnectionTd s..ctor(DbConne ctionPoolIdenti ty
    identity, SqlConnectionSt ring connectionOptio ns, Object providerInfo,
    String newPassword, SqlConnection owningObject, Boolean
    redirectedUserI nstance) +173
    >
    System.Data.Sql Client.SqlConne ctionFactory.Cr eateConnection( DbConnectionOpt ions
    options, Object poolGroupProvid erInfo, DbConnectionPoo l pool, DbConnection
    owningConnectio n) +133
    >
    System.Data.Pro viderBase.DbCon nectionFactory. CreatePooledCon nection(DbConne ction
    owningConnectio n, DbConnectionPoo l pool, DbConnectionOpt ions options) +30
    System.Data.Pro viderBase.DbCon nectionPool.Cre ateObject(DbCon nection
    owningObject) +424
    System.Data.Pro viderBase.DbCon nectionPool.Use rCreateRequest( DbConnection
    owningObject) +66
    System.Data.Pro viderBase.DbCon nectionPool.Get Connection(DbCo nnection
    owningObject) +494
    System.Data.Pro viderBase.DbCon nectionFactory. GetConnection(D bConnection
    owningConnectio n) +82
    System.Data.Pro viderBase.DbCon nectionClosed.O penConnection(D bConnection
    outerConnection , DbConnectionFac tory connectionFacto ry) +105
    System.Data.Sql Client.SqlConne ction.Open() +111
    System.Web.Data Access.SqlConne ctionHolder.Ope n(HttpContext context,
    Boolean revertImpersona te) +84
    System.Web.Data Access.SqlConne ctionHelper.Get Connection(Stri ng
    connectionStrin g, Boolean revertImpersona tion) +197
    System.Web.Secu rity.SqlRolePro vider.GetRolesF orUser(String username)
    +771
    System.Web.Secu rity.RolePrinci pal.IsInRole(St ring role) +272
    loginredirect.P age_Load(Object sender, EventArgs e) in
    d:\hosting\memb er\myuser4\MyWe bApp\loginredir ect.aspx.vb:6
    System.Web.UI.C ontrol.OnLoad(E ventArgs e) +99
    System.Web.UI.C ontrol.LoadRecu rsive() +47
    System.Web.UI.P age.ProcessRequ estMain(Boolean
    includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint) +1436
    >
    >
    >
    >
    --------------------------------------------------------------------------------
    Version Information: Microsoft .NET Framework Version:2.0.507 27.1433;
    ASP.NET Version:2.0.507 27.1433
    >

    Comment

    • =?Utf-8?B?YnJ1Y2UgYmFya2Vy?=

      #3
      RE: Error &quot;SQL Server does not allow remote connections&quo t;

      the error means that connection to the sqlserver could not be made (name
      resolution or socket open failed). assuming the sqlserver is configured,
      either you have the connection string wrong (name and port number) or the
      network is blocking the connection (firewall rules).

      -- bruce (sqlwork.com)


      "Cirene" wrote:
      I just deployed my new ASP.NET (3.5 FW) site to the hosting company I'm
      using, webhost4life.
      >
      NOTE: I HAVE deployed other SQL Server sites to the same account with no
      issues.
      >
      Now I'm getting this error. Any idea why?
      >
      Server Error in '/myuser4/MyWebApp' Application.
      --------------------------------------------------------------------------------
      >
      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)
      Description: An unhandled exception occurred during the execution of the
      current web request. Please review the stack trace for more information
      about the error and where it originated in the code.
      >
      Exception Details: System.Data.Sql Client.SqlExcep tion: 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)
      >
      Source Error:
      >
      >
      Line 4:
      Line 5: Protected Sub Page_Load(ByVal sender As Object, ByVal e As
      System.EventArg s) Handles Me.Load
      Line 6: If User.IsInRole(" LexAdmin") Or
      User.IsInRole(" LexOperator") Or User.IsInRole(" LexUser") Then
      Line 7: Response.Redire ct("admin/ManagePackages. aspx")
      Line 8: ElseIf User.IsInRole(" CustomerAdmin") Or
      User.IsInRole(" CustomerClient" ) Or User.IsInRole(" CustomerUser") Then
      >
      >
      Source File: d:\hosting\memb er\myuser4\MyWe bApp\loginredir ect.aspx.vb
      Line: 6
      >
      Stack Trace:
      >
      >
      [SqlException (0x80131904): 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)]
      System.Data.Sql Client.SqlInter nalConnection.O nError(SqlExcep tion
      exception, Boolean breakConnection ) +800131
      System.Data.Sql Client.TdsParse r.ThrowExceptio nAndWarning(Tds ParserStateObje ct
      stateObj) +186
      System.Data.Sql Client.TdsParse r.Connect(Serve rInfo serverInfo,
      SqlInternalConn ectionTds connHandler, Boolean ignoreSniOpenTi meout, Int64
      timerExpire, Boolean encrypt, Boolean trustServerCert , Boolean
      integratedSecur ity, SqlConnection owningObject) +737554
      System.Data.Sql Client.SqlInter nalConnectionTd s.AttemptOneLog in(ServerInfo
      serverInfo, String newPassword, Boolean ignoreSniOpenTi meout, Int64
      timerExpire, SqlConnection owningObject) +114
      System.Data.Sql Client.SqlInter nalConnectionTd s.LoginNoFailov er(String
      host, String newPassword, Boolean redirectedUserI nstance, SqlConnection
      owningObject, SqlConnectionSt ring connectionOptio ns, Int64 timerStart) +381
      System.Data.Sql Client.SqlInter nalConnectionTd s.OpenLoginEnli st(SqlConnectio n
      owningObject, SqlConnectionSt ring connectionOptio ns, String newPassword,
      Boolean redirectedUserI nstance) +181
      System.Data.Sql Client.SqlInter nalConnectionTd s..ctor(DbConne ctionPoolIdenti ty
      identity, SqlConnectionSt ring connectionOptio ns, Object providerInfo, String
      newPassword, SqlConnection owningObject, Boolean redirectedUserI nstance)
      +173
      System.Data.Sql Client.SqlConne ctionFactory.Cr eateConnection( DbConnectionOpt ions
      options, Object poolGroupProvid erInfo, DbConnectionPoo l pool, DbConnection
      owningConnectio n) +133
      System.Data.Pro viderBase.DbCon nectionFactory. CreatePooledCon nection(DbConne ction
      owningConnectio n, DbConnectionPoo l pool, DbConnectionOpt ions options) +30
      System.Data.Pro viderBase.DbCon nectionPool.Cre ateObject(DbCon nection
      owningObject) +424
      System.Data.Pro viderBase.DbCon nectionPool.Use rCreateRequest( DbConnection
      owningObject) +66
      System.Data.Pro viderBase.DbCon nectionPool.Get Connection(DbCo nnection
      owningObject) +494
      System.Data.Pro viderBase.DbCon nectionFactory. GetConnection(D bConnection
      owningConnectio n) +82
      System.Data.Pro viderBase.DbCon nectionClosed.O penConnection(D bConnection
      outerConnection , DbConnectionFac tory connectionFacto ry) +105
      System.Data.Sql Client.SqlConne ction.Open() +111
      System.Web.Data Access.SqlConne ctionHolder.Ope n(HttpContext context,
      Boolean revertImpersona te) +84
      System.Web.Data Access.SqlConne ctionHelper.Get Connection(Stri ng
      connectionStrin g, Boolean revertImpersona tion) +197
      System.Web.Secu rity.SqlRolePro vider.GetRolesF orUser(String username) +771
      System.Web.Secu rity.RolePrinci pal.IsInRole(St ring role) +272
      loginredirect.P age_Load(Object sender, EventArgs e) in
      d:\hosting\memb er\myuser4\MyWe bApp\loginredir ect.aspx.vb:6
      System.Web.UI.C ontrol.OnLoad(E ventArgs e) +99
      System.Web.UI.C ontrol.LoadRecu rsive() +47
      System.Web.UI.P age.ProcessRequ estMain(Boolean
      includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint) +1436
      >
      >
      >
      >
      --------------------------------------------------------------------------------
      Version Information: Microsoft .NET Framework Version:2.0.507 27.1433;
      ASP.NET Version:2.0.507 27.1433
      >
      >
      >

      Comment

      • George Ter-Saakov

        #4
        Re: Error &quot;SQL Server does not allow remote connections&quo t;

        From error "...provide r: Named Pipes Provider" I understand that you using
        Named Pipes protocol and not TCP/IP.

        Named pipes protocol works well only in Domain environment.
        It has embedded NT authentication. So if guest account disabled on the
        server then Named pipes connection will be refused.

        You need to switch it to TCP/IP
        Try to add "Network Library=DBMSSOC N" to your connection string
        "Data Source=190.190. 200.100,1433;Ne twork Library=DBMSSOC N;Initial
        Catalog=myDataB ase;User ID=myUsername;P assword=myPassw ord;"

        George.


        "bruce barker" <brucebarker@di scussions.micro soft.comwrote in message
        news:EC7F21EE-B8E2-4F46-8ED6-8E1FB7383CAB@mi crosoft.com...
        the error means that connection to the sqlserver could not be made (name
        resolution or socket open failed). assuming the sqlserver is configured,
        either you have the connection string wrong (name and port number) or the
        network is blocking the connection (firewall rules).
        >
        -- bruce (sqlwork.com)
        >
        >
        "Cirene" wrote:
        >
        >I just deployed my new ASP.NET (3.5 FW) site to the hosting company I'm
        >using, webhost4life.
        >>
        >NOTE: I HAVE deployed other SQL Server sites to the same account with no
        >issues.
        >>
        >Now I'm getting this error. Any idea why?
        >>
        >Server Error in '/myuser4/MyWebApp' Application.
        >--------------------------------------------------------------------------------
        >>
        >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)
        >Description: An unhandled exception occurred during the execution of the
        >current web request. Please review the stack trace for more information
        >about the error and where it originated in the code.
        >>
        >Exception Details: System.Data.Sql Client.SqlExcep tion: 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)
        >>
        >Source Error:
        >>
        >>
        >Line 4:
        >Line 5: Protected Sub Page_Load(ByVal sender As Object, ByVal e As
        >System.EventAr gs) Handles Me.Load
        >Line 6: If User.IsInRole(" LexAdmin") Or
        >User.IsInRole( "LexOperato r") Or User.IsInRole(" LexUser") Then
        >Line 7: Response.Redire ct("admin/ManagePackages. aspx")
        >Line 8: ElseIf User.IsInRole(" CustomerAdmin") Or
        >User.IsInRole( "CustomerClient ") Or User.IsInRole(" CustomerUser") Then
        >>
        >>
        >Source File: d:\hosting\memb er\myuser4\MyWe bApp\loginredir ect.aspx.vb
        >Line: 6
        >>
        >Stack Trace:
        >>
        >>
        >[SqlException (0x80131904): 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)]
        > System.Data.Sql Client.SqlInter nalConnection.O nError(SqlExcep tion
        >exception, Boolean breakConnection ) +800131
        >>
        >System.Data.Sq lClient.TdsPars er.ThrowExcepti onAndWarning(Td sParserStateObj ect
        >stateObj) +186
        > System.Data.Sql Client.TdsParse r.Connect(Serve rInfo serverInfo,
        >SqlInternalCon nectionTds connHandler, Boolean ignoreSniOpenTi meout, Int64
        >timerExpire, Boolean encrypt, Boolean trustServerCert , Boolean
        >integratedSecu rity, SqlConnection owningObject) +737554
        >>
        >System.Data.Sq lClient.SqlInte rnalConnectionT ds.AttemptOneLo gin(ServerInfo
        >serverInfo, String newPassword, Boolean ignoreSniOpenTi meout, Int64
        >timerExpire, SqlConnection owningObject) +114
        > System.Data.Sql Client.SqlInter nalConnectionTd s.LoginNoFailov er(String
        >host, String newPassword, Boolean redirectedUserI nstance, SqlConnection
        >owningObject , SqlConnectionSt ring connectionOptio ns, Int64 timerStart)
        >+381
        >>
        >System.Data.Sq lClient.SqlInte rnalConnectionT ds.OpenLoginEnl ist(SqlConnecti on
        >owningObject , SqlConnectionSt ring connectionOptio ns, String newPassword,
        >Boolean redirectedUserI nstance) +181
        >>
        >System.Data.Sq lClient.SqlInte rnalConnectionT ds..ctor(DbConn ectionPoolIdent ity
        >identity, SqlConnectionSt ring connectionOptio ns, Object providerInfo,
        >String
        >newPassword, SqlConnection owningObject, Boolean redirectedUserI nstance)
        >+173
        >>
        >System.Data.Sq lClient.SqlConn ectionFactory.C reateConnection (DbConnectionOp tions
        >options, Object poolGroupProvid erInfo, DbConnectionPoo l pool,
        >DbConnection
        >owningConnecti on) +133
        >>
        >System.Data.Pr oviderBase.DbCo nnectionFactory .CreatePooledCo nnection(DbConn ection
        >owningConnecti on, DbConnectionPoo l pool, DbConnectionOpt ions options) +30
        > System.Data.Pro viderBase.DbCon nectionPool.Cre ateObject(DbCon nection
        >owningObject ) +424
        >>
        >System.Data.Pr oviderBase.DbCo nnectionPool.Us erCreateRequest (DbConnection
        >owningObject ) +66
        > System.Data.Pro viderBase.DbCon nectionPool.Get Connection(DbCo nnection
        >owningObject ) +494
        >>
        >System.Data.Pr oviderBase.DbCo nnectionFactory .GetConnection( DbConnection
        >owningConnecti on) +82
        >>
        >System.Data.Pr oviderBase.DbCo nnectionClosed. OpenConnection( DbConnection
        >outerConnectio n, DbConnectionFac tory connectionFacto ry) +105
        > System.Data.Sql Client.SqlConne ction.Open() +111
        > System.Web.Data Access.SqlConne ctionHolder.Ope n(HttpContext context,
        >Boolean revertImpersona te) +84
        > System.Web.Data Access.SqlConne ctionHelper.Get Connection(Stri ng
        >connectionStri ng, Boolean revertImpersona tion) +197
        > System.Web.Secu rity.SqlRolePro vider.GetRolesF orUser(String username)
        >+771
        > System.Web.Secu rity.RolePrinci pal.IsInRole(St ring role) +272
        > loginredirect.P age_Load(Object sender, EventArgs e) in
        >d:\hosting\mem ber\myuser4\MyW ebApp\loginredi rect.aspx.vb:6
        > System.Web.UI.C ontrol.OnLoad(E ventArgs e) +99
        > System.Web.UI.C ontrol.LoadRecu rsive() +47
        > System.Web.UI.P age.ProcessRequ estMain(Boolean
        >includeStagesB eforeAsyncPoint , Boolean includeStagesAf terAsyncPoint)
        >+1436
        >>
        >>
        >>
        >>
        >--------------------------------------------------------------------------------
        >Version Information: Microsoft .NET Framework Version:2.0.507 27.1433;
        >ASP.NET Version:2.0.507 27.1433
        >>
        >>
        >>

        Comment

        • Cirene

          #5
          Re: Error &quot;SQL Server does not allow remote connections&quo t;

          I'm using the exact connection string (different db of course) of other
          websites that ARE working.

          Is this wierd? Any more ideas?

          Thanks!

          "bruce barker" <brucebarker@di scussions.micro soft.comwrote in message
          news:EC7F21EE-B8E2-4F46-8ED6-8E1FB7383CAB@mi crosoft.com...
          the error means that connection to the sqlserver could not be made (name
          resolution or socket open failed). assuming the sqlserver is configured,
          either you have the connection string wrong (name and port number) or the
          network is blocking the connection (firewall rules).
          >
          -- bruce (sqlwork.com)
          >
          >
          "Cirene" wrote:
          >
          >I just deployed my new ASP.NET (3.5 FW) site to the hosting company I'm
          >using, webhost4life.
          >>
          >NOTE: I HAVE deployed other SQL Server sites to the same account with no
          >issues.
          >>
          >Now I'm getting this error. Any idea why?
          >>
          >Server Error in '/myuser4/MyWebApp' Application.
          >--------------------------------------------------------------------------------
          >>
          >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)
          >Description: An unhandled exception occurred during the execution of the
          >current web request. Please review the stack trace for more information
          >about the error and where it originated in the code.
          >>
          >Exception Details: System.Data.Sql Client.SqlExcep tion: 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)
          >>
          >Source Error:
          >>
          >>
          >Line 4:
          >Line 5: Protected Sub Page_Load(ByVal sender As Object, ByVal e As
          >System.EventAr gs) Handles Me.Load
          >Line 6: If User.IsInRole(" LexAdmin") Or
          >User.IsInRole( "LexOperato r") Or User.IsInRole(" LexUser") Then
          >Line 7: Response.Redire ct("admin/ManagePackages. aspx")
          >Line 8: ElseIf User.IsInRole(" CustomerAdmin") Or
          >User.IsInRole( "CustomerClient ") Or User.IsInRole(" CustomerUser") Then
          >>
          >>
          >Source File: d:\hosting\memb er\myuser4\MyWe bApp\loginredir ect.aspx.vb
          >Line: 6
          >>
          >Stack Trace:
          >>
          >>
          >[SqlException (0x80131904): 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)]
          > System.Data.Sql Client.SqlInter nalConnection.O nError(SqlExcep tion
          >exception, Boolean breakConnection ) +800131
          >>
          >System.Data.Sq lClient.TdsPars er.ThrowExcepti onAndWarning(Td sParserStateObj ect
          >stateObj) +186
          > System.Data.Sql Client.TdsParse r.Connect(Serve rInfo serverInfo,
          >SqlInternalCon nectionTds connHandler, Boolean ignoreSniOpenTi meout, Int64
          >timerExpire, Boolean encrypt, Boolean trustServerCert , Boolean
          >integratedSecu rity, SqlConnection owningObject) +737554
          >>
          >System.Data.Sq lClient.SqlInte rnalConnectionT ds.AttemptOneLo gin(ServerInfo
          >serverInfo, String newPassword, Boolean ignoreSniOpenTi meout, Int64
          >timerExpire, SqlConnection owningObject) +114
          > System.Data.Sql Client.SqlInter nalConnectionTd s.LoginNoFailov er(String
          >host, String newPassword, Boolean redirectedUserI nstance, SqlConnection
          >owningObject , SqlConnectionSt ring connectionOptio ns, Int64 timerStart)
          >+381
          >>
          >System.Data.Sq lClient.SqlInte rnalConnectionT ds.OpenLoginEnl ist(SqlConnecti on
          >owningObject , SqlConnectionSt ring connectionOptio ns, String newPassword,
          >Boolean redirectedUserI nstance) +181
          >>
          >System.Data.Sq lClient.SqlInte rnalConnectionT ds..ctor(DbConn ectionPoolIdent ity
          >identity, SqlConnectionSt ring connectionOptio ns, Object providerInfo,
          >String
          >newPassword, SqlConnection owningObject, Boolean redirectedUserI nstance)
          >+173
          >>
          >System.Data.Sq lClient.SqlConn ectionFactory.C reateConnection (DbConnectionOp tions
          >options, Object poolGroupProvid erInfo, DbConnectionPoo l pool,
          >DbConnection
          >owningConnecti on) +133
          >>
          >System.Data.Pr oviderBase.DbCo nnectionFactory .CreatePooledCo nnection(DbConn ection
          >owningConnecti on, DbConnectionPoo l pool, DbConnectionOpt ions options) +30
          > System.Data.Pro viderBase.DbCon nectionPool.Cre ateObject(DbCon nection
          >owningObject ) +424
          >>
          >System.Data.Pr oviderBase.DbCo nnectionPool.Us erCreateRequest (DbConnection
          >owningObject ) +66
          > System.Data.Pro viderBase.DbCon nectionPool.Get Connection(DbCo nnection
          >owningObject ) +494
          >>
          >System.Data.Pr oviderBase.DbCo nnectionFactory .GetConnection( DbConnection
          >owningConnecti on) +82
          >>
          >System.Data.Pr oviderBase.DbCo nnectionClosed. OpenConnection( DbConnection
          >outerConnectio n, DbConnectionFac tory connectionFacto ry) +105
          > System.Data.Sql Client.SqlConne ction.Open() +111
          > System.Web.Data Access.SqlConne ctionHolder.Ope n(HttpContext context,
          >Boolean revertImpersona te) +84
          > System.Web.Data Access.SqlConne ctionHelper.Get Connection(Stri ng
          >connectionStri ng, Boolean revertImpersona tion) +197
          > System.Web.Secu rity.SqlRolePro vider.GetRolesF orUser(String username)
          >+771
          > System.Web.Secu rity.RolePrinci pal.IsInRole(St ring role) +272
          > loginredirect.P age_Load(Object sender, EventArgs e) in
          >d:\hosting\mem ber\myuser4\MyW ebApp\loginredi rect.aspx.vb:6
          > System.Web.UI.C ontrol.OnLoad(E ventArgs e) +99
          > System.Web.UI.C ontrol.LoadRecu rsive() +47
          > System.Web.UI.P age.ProcessRequ estMain(Boolean
          >includeStagesB eforeAsyncPoint , Boolean includeStagesAf terAsyncPoint)
          >+1436
          >>
          >>
          >>
          >>
          >--------------------------------------------------------------------------------
          >Version Information: Microsoft .NET Framework Version:2.0.507 27.1433;
          >ASP.NET Version:2.0.507 27.1433
          >>
          >>
          >>

          Comment

          • =?Utf-8?B?Q2hpZ2J1YVVtdWVudQ==?=

            #6
            Re: Error &quot;SQL Server does not allow remote connections&quo t;

            Hello Cirene,

            I have had similar experience with 1and1.com.

            I had a hosting account with them and decided to connect my application that
            was hosted somewhere else to the sql server database i have with them.

            The application could not connect to the sql server db. Some hosting may
            require that your application be hosted on their enviroment before you can
            access the sql server database.

            You can also check how you're managing the roles. Are you using an attached
            database to manage the roles? If yes, you have to grant ASP.NET access to the
            folder containing the database file.

            Thank you,
            Okoronkwo Alfred Chinedu
            --
            Okoronkwo Chinedu
            Crazy About Learning


            "Cirene" wrote:
            I'm using the exact connection string (different db of course) of other
            websites that ARE working.
            >
            Is this wierd? Any more ideas?
            >
            Thanks!
            >
            "bruce barker" <brucebarker@di scussions.micro soft.comwrote in message
            news:EC7F21EE-B8E2-4F46-8ED6-8E1FB7383CAB@mi crosoft.com...
            the error means that connection to the sqlserver could not be made (name
            resolution or socket open failed). assuming the sqlserver is configured,
            either you have the connection string wrong (name and port number) or the
            network is blocking the connection (firewall rules).

            -- bruce (sqlwork.com)


            "Cirene" wrote:
            I just deployed my new ASP.NET (3.5 FW) site to the hosting company I'm
            using, webhost4life.
            >
            NOTE: I HAVE deployed other SQL Server sites to the same account with no
            issues.
            >
            Now I'm getting this error. Any idea why?
            >
            Server Error in '/myuser4/MyWebApp' Application.
            --------------------------------------------------------------------------------
            >
            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)
            Description: An unhandled exception occurred during the execution of the
            current web request. Please review the stack trace for more information
            about the error and where it originated in the code.
            >
            Exception Details: System.Data.Sql Client.SqlExcep tion: 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)
            >
            Source Error:
            >
            >
            Line 4:
            Line 5: Protected Sub Page_Load(ByVal sender As Object, ByVal e As
            System.EventArg s) Handles Me.Load
            Line 6: If User.IsInRole(" LexAdmin") Or
            User.IsInRole(" LexOperator") Or User.IsInRole(" LexUser") Then
            Line 7: Response.Redire ct("admin/ManagePackages. aspx")
            Line 8: ElseIf User.IsInRole(" CustomerAdmin") Or
            User.IsInRole(" CustomerClient" ) Or User.IsInRole(" CustomerUser") Then
            >
            >
            Source File: d:\hosting\memb er\myuser4\MyWe bApp\loginredir ect.aspx.vb
            Line: 6
            >
            Stack Trace:
            >
            >
            [SqlException (0x80131904): 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)]
            System.Data.Sql Client.SqlInter nalConnection.O nError(SqlExcep tion
            exception, Boolean breakConnection ) +800131
            >
            System.Data.Sql Client.TdsParse r.ThrowExceptio nAndWarning(Tds ParserStateObje ct
            stateObj) +186
            System.Data.Sql Client.TdsParse r.Connect(Serve rInfo serverInfo,
            SqlInternalConn ectionTds connHandler, Boolean ignoreSniOpenTi meout, Int64
            timerExpire, Boolean encrypt, Boolean trustServerCert , Boolean
            integratedSecur ity, SqlConnection owningObject) +737554
            >
            System.Data.Sql Client.SqlInter nalConnectionTd s.AttemptOneLog in(ServerInfo
            serverInfo, String newPassword, Boolean ignoreSniOpenTi meout, Int64
            timerExpire, SqlConnection owningObject) +114
            System.Data.Sql Client.SqlInter nalConnectionTd s.LoginNoFailov er(String
            host, String newPassword, Boolean redirectedUserI nstance, SqlConnection
            owningObject, SqlConnectionSt ring connectionOptio ns, Int64 timerStart)
            +381
            >
            System.Data.Sql Client.SqlInter nalConnectionTd s.OpenLoginEnli st(SqlConnectio n
            owningObject, SqlConnectionSt ring connectionOptio ns, String newPassword,
            Boolean redirectedUserI nstance) +181
            >
            System.Data.Sql Client.SqlInter nalConnectionTd s..ctor(DbConne ctionPoolIdenti ty
            identity, SqlConnectionSt ring connectionOptio ns, Object providerInfo,
            String
            newPassword, SqlConnection owningObject, Boolean redirectedUserI nstance)
            +173
            >
            System.Data.Sql Client.SqlConne ctionFactory.Cr eateConnection( DbConnectionOpt ions
            options, Object poolGroupProvid erInfo, DbConnectionPoo l pool,
            DbConnection
            owningConnectio n) +133
            >
            System.Data.Pro viderBase.DbCon nectionFactory. CreatePooledCon nection(DbConne ction
            owningConnectio n, DbConnectionPoo l pool, DbConnectionOpt ions options) +30
            System.Data.Pro viderBase.DbCon nectionPool.Cre ateObject(DbCon nection
            owningObject) +424
            >
            System.Data.Pro viderBase.DbCon nectionPool.Use rCreateRequest( DbConnection
            owningObject) +66
            System.Data.Pro viderBase.DbCon nectionPool.Get Connection(DbCo nnection
            owningObject) +494
            >
            System.Data.Pro viderBase.DbCon nectionFactory. GetConnection(D bConnection
            owningConnectio n) +82
            >
            System.Data.Pro viderBase.DbCon nectionClosed.O penConnection(D bConnection
            outerConnection , DbConnectionFac tory connectionFacto ry) +105
            System.Data.Sql Client.SqlConne ction.Open() +111
            System.Web.Data Access.SqlConne ctionHolder.Ope n(HttpContext context,
            Boolean revertImpersona te) +84
            System.Web.Data Access.SqlConne ctionHelper.Get Connection(Stri ng
            connectionStrin g, Boolean revertImpersona tion) +197
            System.Web.Secu rity.SqlRolePro vider.GetRolesF orUser(String username)
            +771
            System.Web.Secu rity.RolePrinci pal.IsInRole(St ring role) +272
            loginredirect.P age_Load(Object sender, EventArgs e) in
            d:\hosting\memb er\myuser4\MyWe bApp\loginredir ect.aspx.vb:6
            System.Web.UI.C ontrol.OnLoad(E ventArgs e) +99
            System.Web.UI.C ontrol.LoadRecu rsive() +47
            System.Web.UI.P age.ProcessRequ estMain(Boolean
            includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint)
            +1436
            >
            >
            >
            >
            --------------------------------------------------------------------------------
            Version Information: Microsoft .NET Framework Version:2.0.507 27.1433;
            ASP.NET Version:2.0.507 27.1433
            >
            >
            >
            >
            >
            >

            Comment

            Working...