Establishes a relationship between an item stored in an application's Cache object and either a row in a specific SQL Server database table or the results of a SQL Server 2005 query.
[Serializable] public sealed class SqlCacheDependency : CacheDependency, IDisposable
You can add items with dependencies to your application's cache with the specific overloads of Add and Insert methods.
When you add an item to an application's cache object with
SqlCacheDependency, on all supported versions of SQL Server (7.0, 2000, 2005), it monitors a
row in a specific SQL Server database table so that when that row changes, items associated with
the row will be automatically removed from the Cache.
This helps you avoid losing changes made to the object between the time it is created and the time it is inserted into the cache. SqlCacheDependency class supports the association of cached items with a SQL Server query when SQL Server 2005 is used.
Initializes a new instance of the SqlCacheDependency class, using the supplied connection string and query string.
|SqlCacheDependency(String, String, SqlCommandType, Dictionary<String, SqlCmdParams>)||
Initializes a new instance of the SqlCacheDependency class. It supports the use of 'Stored Procedures'.
Parameters to be used by dependency.
CommandText to be used by dependency.
Describes the type of the SQL command passed to the SQLDependency.
Connection String is the connection string that is required to the cache in order to connect with database.