积极答复者
.net EnableTableForNotifications 无效?改变相应数据库后cache依然不消失?

问题
-
如题,我改变了对应数据表的数据但是数据表依赖的cache还是不失效,但是如果在数据查询分析器里手动查询值后,cache就正常失效了,这是为什么啊?怎样让不手动查询cache也会自动失效?下面为tabledependency的相关代码。
protected TableDependency(string configKey)
{
System.Web.Caching.SqlCacheDependencyAdmin.EnableNotifications(BLL.FunctionRule.GetConnectionString());
string dbName = ConfigurationManager.AppSettings["CacheDatabaseName"];
string tableConfig = ConfigurationManager.AppSettings[configKey];
string[] tables = tableConfig.Split(configurationSeparator);
System.Web.Caching.SqlCacheDependencyAdmin.EnableTableForNotifications(BLL.FunctionRule.GetConnectionString(), tables);foreach (string tableName in tables)
dependency.Add(new SqlCacheDependency(dbName, tableName));
}