0
SqlCacheDependencyAdmin.EnableNotifications(connString);
SqlCacheDependencyAdmin.EnableTableForNotifications(connString, tableName);
SqlCacheDependency sqlDenpendency = new SqlCacheDependency(entryName, tableName);
HttpRuntime.Cache.Insert(key,lstData,sqlDenpendency,DateTime.Now.AddMinutes(timeout), Cache.NoSlidingExpiration);

当我使用 SqlCacheDependency 将一些数据保存到HttpRuntime.Cache这样的地方时,出现以下运行时错误:

当前用户 uu163 没有权限。事务在触发器中结束。该批次已中止。

[SqlException (0x80131904): 当前用户 uu163 没有权限。事务在触发器中结束。批处理已中止。] System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) +2442126 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) +5736904 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +628 System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet stateOjbjHandler, TdsParser , Boolean& dataReady) +3731 System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite) +940 System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 完成, String methodName, Boolean sendToPipe , Int32 超时, Boolean asyncWrite) +272 System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +280 System.Web.Caching.SqlCacheDependencyAdmin.SetupNotifications(Int32 flags,字符串表,字符串连接String) +752

如何解决这个错误?

4

0 回答 0