An error has occurred while establishing a connection to the server

Discussion in 'Databases' started by read.andrew, May 25, 2007.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I keep on receiving the following error when I try to access one part of my site.


    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)]
    Infragistics.WebUI.Data.WebScheduleDbProvider.FireDataProviderError(Object sender, DataProviderErrorEventArgs args) +1079
    Infragistics.WebUI.Data.WebScheduleDbProvider.OnDataError(Object sender, DataProviderErrorEventArgs args) +8
    Infragistics.WebUI.Data.WebScheduleDbProvider.FetchResource(FetchResourcesContext context) +452
    Infragistics.WebUI.Data.WebScheduleDbProvider.Fetch(DataContext context) +95
    Infragistics.WebUI.WebSchedule.WebScheduleInfo_OnDataBinding(EventArgs e) +341
    Infragistics.WebUI.WebSchedule.WebScheduleInfo.DataBind() +13
    Infragistics.WebUI.WebSchedule.WebScheduleInfo_OnPreRender(EventArgs e) +164
    System.Web.UI.Control.PreRenderRecursiveInternal() +77
    System.Web.UI.Control.PreRenderRecursiveInternal() +161
    System.Web.UI.Control.PreRenderRecursiveInternal() +161
    System.Web.UI.Control.PreRenderRecursiveInternal() +161
    System.Web.UI.Control.PreRenderRecursiveInternal() +161
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360
    </font>

    This is my connection string:

    <connectionStrings>
    <remove name='LocalSqlServer'/>
    <add name='LocalSqlServer' connectionString='Data Source=sql2k508.discountasp.net;Integrated Security=false;Initial Catalog=SQL2005_368422_twisty;User ID=******;Password=*******' providerName='System.Data.SqlClient'/>
    <add name='Personal' connectionString='Data Source=sql2k508.discountasp.net;Integrated Security=false;Initial Catalog=SQL2005_368422_twisty;User ID=*******;Password=*******' providerName='System.Data.SqlClient'/>
    <add name='WebScheduleConnectionString' connectionString='Data Source=216.177.91.10;Initial Catalog=SQL2005_368422_twisty;User ID=*******;Password=*******;Network Library=DBMSSOCN' providerName='System.Data.SqlClient'/>
    </connectionStrings>

    I have the personal website starter kit with an addon.
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    Problem should be caused by this connection string

    <add name="WebScheduleConnectionString" connectionString="Data Source=216.177.91.10;Initial Catalog=SQL2005_368422_twisty;User ID=*******;Password=*******;Network Library=DBMSSOCN"

    Change it to

    <add name="WebScheduleConnectionString" connectionString="Data Source=sql2k508.discountasp.net;Integrated Security=false;Initial Catalog=SQL2005_368422_twisty;User ID=*******;Password=*******" providerName="System.Data.SqlClient"/>

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page