网站没有加载,所有我看到的是这些Sql Server错误被捕获&记录

时间:2011-03-24 09:39:08

标签: asp.net sql-server

背景:我们从Sql Server 2005迁移到Sql Server 2008 R2。此应用程序部署到4个Web服务器。其中只有一个造成了麻烦。只有(可能)页面将加载10次,否则根本不会返回任何内容,如完全空的响应

这是第一个捕获的错误

Error 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)

Source: .Net SqlClient Data Provider

Stack Trace:    at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
   at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
   at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
   at System.Data.SqlClient.SqlConnection.Open()
   at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
   at System.Data.SqlClient.SqlConnection.Open()
   at System.Web.SessionState.SqlSessionStateStore.SqlStateConnection..ctor(SqlPartitionInfo sqlPartitionInfo)

这是第二个:

Error 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)

Source: .Net SqlClient Data Provider

Stack Trace:    at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
   at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
   at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
   at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
   at System.Data.SqlClient.SqlConnection.Open()
   at System.Web.SessionState.SqlSessionStateStore.SqlStateConnection..ctor(SqlPartitionInfo sqlPartitionInfo)
   at System.Web.SessionState.SqlSessionStateStore.SqlStateConnection..ctor(SqlPartitionInfo sqlPartitionInfo)

我不知道问题可能是什么。

2 个答案:

答案 0 :(得分:2)

您的第一个错误始于......

  

错误消息:发生错误   同时与之建立联系   服务器。连接到 SQL时   Server 2005

请记住,您已经升级到SQL Server 2008 R2,看起来某些东西仍在引用旧的SQL Server 2005实例?我会检查你的asp.net应用程序,以确保它具有新SQL Server的正确连接设置。

在SQL Server上,您可以检查以确保SQL Server允许远程连接。

答案 1 :(得分:1)

在调用堆栈中,似乎应用程序的某个web.config文件可能配置为在SQL Server中使用ASP.NET会话状态存储。你说它被部署到4台服务器。我会检查所有的web.config文件,并确保你没有在3上使用进程内会话状态,然后尝试在SQL中使用会话状态存储。