【发布时间】:2012-06-27 09:33:01
【问题描述】:
我的服务器上有一些旧数据库,因此将旧的、未使用的数据库脱机。
这导致了一个非常奇怪的问题,因为我的网站抱怨无法连接到这些数据库之一。
我已经在整个代码库中搜索了数据库名称以及服务器上的所有配置文件,但没有一个引用此数据库名称,但是如果我离线,我会收到错误消息?
我无法从错误中看到实际发出连接请求的原因,除了它看起来与 SQL 会话服务器有关。
[SqlException (0x80131904): 数据库 'MyOldDatabaseName' 不能 因离线而打开。]
System.Data.SqlClient.SqlConnection.OnError(SqlException 异常, 布尔中断连接)+1953274
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException 异常,布尔型 breakConnection) +4849707
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior、SqlCommand cmdHandler、SqlDataReader 数据流、 BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2392
System.Data.SqlClient.SqlDataReader.ConsumeMetaData() +33
System.Data.SqlClient.SqlDataReader.get_MetaData() +96
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior,字符串 resetOptionsString) +297
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior、RunBehavior runBehavior、布尔 returnStream、布尔 异步)+954
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior、RunBehavior、runBehavior、布尔返回流、字符串 方法,DbAsyncResult 结果)+162
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior、RunBehavior、runBehavior、布尔返回流、字符串 方法)+32
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior 行为,字符串方法)+141
System.Data.SqlClient.SqlCommand.ExecuteReader() +89
System.Web.SessionState.SqlSessionStateStore.DoGet(HttpContext 上下文、字符串 id、布尔 getExclusive、Boolean& 锁定、TimeSpan& lockAge, Object& lockId, SessionStateActions& actionFlags) +516[HttpException (0x80004005): 无法连接到 SQL Server 会话 数据库。]
System.Web.SessionState.SqlSessionStateStore.ThrowSqlConnectionException(SqlConnection 康,例外 e) +229
System.Web.SessionState.SqlSessionStateStore.DoGet(HttpContext 上下文、字符串 id、布尔 getExclusive、Boolean& 锁定、TimeSpan& lockAge, Object& lockId, SessionStateActions& actionFlags) +649
System.Web.SessionState.SqlSessionStateStore.GetItemExclusive(HttpContext 上下文、字符串 id、Boolean& 锁定、TimeSpan& lockAge、Object& lockId, SessionStateActions & actionFlags) +48
System.Web.SessionState.SessionStateModule.GetSessionStateItem() +117 System.Web.SessionState.SessionStateModule.BeginAcquireState(对象 源,EventArgs e,AsyncCallback cb,对象 extraData)+487
System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +66 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
【问题讨论】:
-
我检查了 machine.config 文件,也没有参考。我还从我的 bin 文件夹中删除了所有旧的 dll。与 dev 完全同步,我什至没有同名的数据库
标签: asp.net sql-server