“/”应用程序中的服务器错误。

在与 SQL Server 建立连接时出现与网络相关的或特定于实例的错误。未找到或无法访问服务器。请验证实例名称是否正确并且 SQL Server 已配置为允许远程连接。 (provider: 命名管道提供程序, error: 40 - 无法打开到 SQL Server 的连接)

说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: System.Data.SqlClient.SqlException: 在与 SQL Server 建立连接时出现与网络相关的或特定于实例的错误。未找到或无法访问服务器。请验证实例名称是否正确并且 SQL Server 已配置为允许远程连接。 (provider: 命名管道提供程序, error: 40 - 无法打开到 SQL Server 的连接)

源错误:


行 42:         DataTable orderdetailDT = new DataTable();
行 43:         string sql = "select otd.ID as otdid, OrderID, otd.LotteryNumber as OTDLotteryNumber, LotteryCode, LotteryTicket, WinningState, WinningMoney, otd.Temp1 as OTDTemp1, otd.Temp2 as OTDTemp2, otd.Temp3 as OTDTemp3, otd.Temp4, otd.Temp5,ot.ID, MemberID, ot.CatalogID, TypeID, OrderNumber, ot.LotteryNumber, RemarkType, AddTime, PayMoneyCount, OrderState, WinningCount, IfClearing, ot.Temp1, ot.Temp2, ot.Temp3, ot.Temp4, ot.Temp5,LotteryType  from dbo.LO_OrderTicketDetails as otd left join dbo.LO_OrderTicket as ot on otd.OrderID=ot.ID left join LO_LotteryType on ot.TypeID=LO_LotteryType.ID where MemberID='" + UserID + "' order by AddTime desc";
行 44:         orderdetailDT = DBHandlerFactory.CreateDBHander().ExecuteDataTable(sql, true);
行 45: 
行 46:         return orderdetailDT;

源文件: e:\Site\tc.eshopmates.com\WebSite\App_Code\UserCenterClass.cs    行: 44

堆栈跟踪:


[SqlException (0x80131904): 在与 SQL Server 建立连接时出现与网络相关的或特定于实例的错误。未找到或无法访问服务器。请验证实例名称是否正确并且 SQL Server 已配置为允许远程连接。 (provider: 命名管道提供程序, error: 40 - 无法打开到 SQL Server 的连接)]
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +6256377
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +245
   System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject) +6270399
   System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +181
   System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +6271242
   System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +6271208
   System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +354
   System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +703
   System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +54
   System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +6272472
   System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +81
   System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +1657
   System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +88
   System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +6275911
   System.Data.SqlClient.SqlConnection.Open() +258
   EAD.Framework.SQLDBHandler.ConnectionOpen() in E:\mine\vs2008\EAD V0.4\EAD.Framework\DBHandler\SQLDBHandler.cs:215
   EAD.Framework.SQLDBHandler.ExecuteDataTable(String commandText, CommandType commandType, String tableName, Boolean isCloseConnection) in E:\mine\vs2008\EAD V0.4\EAD.Framework\DBHandler\SQLDBHandler.cs:544
   EAD.Framework.SQLDBHandler.ExecuteDataTable(String commandText, Boolean isCloseConnection) in E:\mine\vs2008\EAD V0.4\EAD.Framework\DBHandler\SQLDBHandler.cs:523
   UserCenterClass.GetOrderTicketDetailsJoinOrder(String UserID) in e:\Site\tc.eshopmates.com\WebSite\App_Code\UserCenterClass.cs:44
   UserCenter.BindOrderTicket() in e:\Site\tc.eshopmates.com\WebSite\UserCenter.aspx.cs:78
   ASP.usercenter_aspx.__Renderform1(HtmlTextWriter __w, Control parameterContainer) in e:\Site\tc.eshopmates.com\WebSite\UserCenter.aspx:79
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +115
   System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +253
   System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +87
   System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +53
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +240
   System.Web.UI.Page.Render(HtmlTextWriter writer) +38
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4240


版本信息: Microsoft .NET Framework 版本:2.0.50727.5420; ASP.NET 版本:2.0.50727.5420