当前位置:编程学习 > C#/ASP.NET >>

无法连接到 SQL 数据库“YaqiShop1”进行缓存依赖项轮询。

无法连接到 SQL 数据库“YaqiShop1”进行缓存依赖项轮询。 
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 

异常详细信息: System.Web.HttpException: 无法连接到 SQL 数据库“YaqiShop1”进行缓存依赖项轮询。

源错误: 


行 28: 
行 29:             foreach (string tableName in tables)
行 30:                 dependency.Add(new SqlCacheDependency(dbName, tableName));//?????
行 31:         }
行 32: 
 

源文件: C:\Inetpub\wwwroot\YaqiShop\TableCacheDependency\TableDependency.cs    行: 30 

堆栈跟踪: 


[SqlException (0x80131904): 用户 'yaqiShop' 登录失败。]
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +734979
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1838
   System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +33
   System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +628
   System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170
   System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +359
   System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28
   System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424
   System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
   System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +496
   System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82
   System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
   System.Data.SqlClient.SqlConnection.Open() +111
   System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate) +84
   System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +197
   System.Web.Caching.DatabaseNotifState.GetConnection(SqlConnection& sqlConn, SqlCommand& sqlCmd) +182
   System.Web.Caching.SqlCacheDependencyManager.PollDatabaseForChanges(DatabaseNotifState dbState, Boolean fromTimer) +523

[HttpException (0x80004005): 无法连接到 SQL 数据库“YaqiShop1”进行缓存依赖项轮询。]
   System.Web.Caching.SqlCacheDependencyManager.EnsureTableIsRegisteredAndPolled(String database, String table) +3082403
   System.Web.Caching.SqlCacheDependency.GetDependKey(String database, String tableName) +57
   System.Web.Caching.SqlCacheDependency..ctor(String databaseEntryName, String tableName) +37
   YaqiShop.TableCacheDependency.TableDependency..ctor(String configKey) in C:\Inetpub\wwwroot\YaqiShop\TableCacheDependency\TableDependency.cs:30
   YaqiShop.TableCacheDependency.Item..ctor() in C:\Inetpub\wwwroot\YaqiShop\TableCacheDependency\Item.cs:12

 


--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:2.0.50727.42; ASP.NET 版本:2.0.50727.42 --------------------编程问答-------------------- 我根据错误信息
[SqlException (0x80131904): 用户 'yaqiShop' 登录失败。]

推断:你的用户名密码错误,或者用户 'yaqiShop' 没有在你指定的数据库中授权

请尝试在查询分析器中登陆测试 --------------------编程问答-------------------- 是没有设置数据库表缓存吧
补充:.NET技术 ,  C#
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,