通过运行命令行进入如下目录:
    C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319
使用下面的命令为 Northwind 数据库中的 Employees 表启用缓存通知:
    aspnet_regsql.exe -S <Server> -U <Username> -P <Password> -ed -d Northwind -et -t Employees

运行之后,查看数据库,会发现生成如下信息:
数据表:AspNet_SqlCacheTablesForChangeNotification;
存储过程:
AspNet_SqlCachePollingStoredProcedure
AspNet_SqlCacheQueryRegisteredTablesStoredProcedure
AspNet_SqlCacheRegisterTableStoredProcedure
AspNet_SqlCacheUnRegisterTableStoredProcedure
AspNet_SqlCacheUpdateChangeIdStoredProcedure
Employees表对应的触发器:
Employees_AspNet_SqlCacheNotification_Trigger

在 Web.config 文件中设置缓存配置

<!-- caching section group -->
<caching>
    <sqlCacheDependency enabled = "true" pollTime = "1000" >
       <databases>
          <add name="Northwind" 
                 connectionStringName="NorthwindConnectionString1"
                 pollTime = "1000"/>
       </databases>
    </sqlCacheDependency>
</caching>

 

相关文章:

  • 2021-07-28
  • 2022-02-25
  • 2022-12-23
  • 2022-12-23
  • 2021-06-16
  • 2022-02-13
  • 2022-12-23
  • 2022-01-22
猜你喜欢
  • 2021-06-20
  • 2021-08-16
  • 2022-01-23
  • 2021-09-01
  • 2021-09-22
相关资源
相似解决方案