Environment
SQL version: MSSQL2005
IDE version: Visual Studio2010
OS: win7
Step 1: Find the location of asp_regsql.exe, which is generally windows \ microsoft.net \ framwork \
Step 2: Run CMD to convert the path to 1
Step 3: Enable database for SQL cache Dependencies
Aspnet_regsql-S localhost-E-d database-ed
Step 4: Enable the tablename table for the SQL cache dependency
Aspnet_regsql-S localhost-E-d database-t tablename-et
Step 5: Add the following configuration under system. web in web. config
<Caching>
<SqlCacheDependency enabled = "true">
<Databases>
<Add name = "databasename" connectionStringName = "ConnectionString is the same as the data connection configuration" pollTime = "12000"> </add>
</Databases>
</SqlCacheDependency>
</Caching>
OK, that's the process.
In this way, when the data in the tablename table of the database is changed, the cache of the program will be cleared.
From line 1 day