Welcome to Sign in | Join | Help
in
Home Forums Photos Downloads

provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server

Last post 05-27-2008, 4:05 PM by Pedro. 5 replies.
Sort Posts: Previous Next
  •  05-15-2008, 3:37 PM 1604

    provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server

    This is horrible !!! If anyone know how to fix this error, please post this thread.

    Thank you very much 

    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.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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    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.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +800131
       System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +186
       System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject) +737554
       System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +114
       System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +421
       System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +181
       System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +173
       System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +357
       System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +30
       System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424
       System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
       System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +494
       System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82
       System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
       System.Data.SqlClient.SqlConnection.Open() +111
       Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters) +196
       Commerce.Providers.SqlCatalogProvider.GetCategoriesSeccion(Int32 SeccionID) in C:\Desarrollo\YachtingSpain\CommerceTemplate\Commerce.CatalogProvider\SqlCatalogProvider.cs:447
    
    [Exception: Error Executing CMRC_CATEGORIES_GetCategoriesSeccion: 
    @SeccionID=1
    ]
       Commerce.Providers.SqlCatalogProvider.GetCategoriesSeccion(Int32 SeccionID) in C:\Desarrollo\YachtingSpain\CommerceTemplate\Commerce.CatalogProvider\SqlCatalogProvider.cs:456
       CatalogManager.GetCategoriesSeccion(Int32 SeccionID) +16
       site.Page_Load(Object sender, EventArgs e) +794
       System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
       System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +33
       System.Web.UI.Control.OnLoad(EventArgs e) +99
       System.Web.UI.Control.LoadRecursive() +47
       System.Web.UI.Control.LoadRecursive() +131
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436
    
  •  05-15-2008, 9:46 PM 1605 in reply to 1604

    Re: provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server

    Do you get this error everytime, or is it intermittent/random?

    Also, could you please post your connection string as well as your code snippit that is generating this error?


    William Eaton, MCSE
    iTech Computer Solutions, LLC
    www.itechcs.com
  •  05-15-2008, 10:13 PM 1606 in reply to 1604

    Re: provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server

    Pedro - Any other info you can provide? I recall you having the same issue before but can't seem to find the prior posts. Is this on a new SQL 2005 Server from what you had before? Do get this error from onluy one site or from multiple sites on the same DB server? Would like to help with your problem but don't have enough to go on at the moment.
  •  05-18-2008, 1:00 PM 1613 in reply to 1606

    Re: provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server

    Hi All,

    Thank you Itechcs and Jhar for your interesting.

    I will post a sumamry of this issue from the begining.

    Since january 2008, I am experiencing this error, each time with more frequency at the day.

    I am not the only one who experience this issue. When this error appear, all web sites based in Dot Net Nuke and CSK goes down.

    It seems that it affect to the applications with 2 simultaneous connections, as DNN and CSK works.

    1 connectrion string hiting ASPNET.mdf and 1 connectrion string hiting CommerceDB.mdf.

    From the begining, I was hosting all my SQL Datsbases in the 69.16.210.14 SQL Server. Then, 2 weeks ago, Ultima Mark suggested me to migrate all my SQL databases to another SQL Server 72.52.146.58. I did it, to see if it solves the problem, and all went well for 1 week, and this error comes again ...

    Last time that I have experienced this error in the new Sql Server, was on thursday 15 may.

    Here is my connections strings for one of my web sites based in CSK 2.0

    <add name="Vertical" connectionString="Data Source=72.52.146.58; initial catalog=YachtingSpain; user ID=xxx; password=xxx;" providerName="System.Data.SqlClient" />

    <add name="Users" connectionString="Data Source=72.52.146.58; initial catalog=YachtingSpain_asp; user ID=xxx; password=xxx;" providerName="System.Data.SqlClient" />

    And here is the web site http://www.yachtingspain-almeria.com

    It seems that Ultima Mark, has found any anomaly with the caches of pool connections on the SQL Server, and he says that James fixed it on the old SQL Server 69.16.210.14.

    He has recomended me to stay in the new Sql Server, I supose that he has fixed this error in this SQL Server too.

    I will post the results on this thread.

    Thank you very much

     

  •  05-18-2008, 6:46 PM 1614 in reply to 1613

    Re: provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server

    If DNN and CSK use simultaneous connections, maybe try adding MARS=True; to your connection strings.  MARS = Multiple Active Result Sets.  MARS is a new feature of SQL 2005.    Also, I don't think I've ever specified the providerName="System.Data.SqlClient" attribute in the connection string.  Try removing it.

    That's about the only ideas I have.


    William Eaton, MCSE
    iTech Computer Solutions, LLC
    www.itechcs.com
  •  05-27-2008, 4:05 PM 1628 in reply to 1614

    Re: provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server

    Hi Itechcs,

    Just right now I am getting this error.

    I have tryed to add MARS=True , but this causes an error "Unrecognized attribute 'MARS'. Note that attribute names are case-sensitive"

    I have removed the atribute providerName too , but nothing happen.

    Thank you very much for your interesting.

View as RSS news feed in XML
Powered by Community Server, by Telligent Systems