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.

Namespace: Alachisoft.NCache.Runtime.Dependencies
Assembly: Alachisoft.NCache.Runtime (in Alachisoft.NCache.Runtime.dll) Version: 4.3.0.0 (4.3.0.0)

Syntax

C#
[SerializableAttribute]
public sealed class SqlCacheDependency : CacheDependency
Visual Basic
<SerializableAttribute>
Public NotInheritable Class SqlCacheDependency
	Inherits CacheDependency
Visual C++
[SerializableAttribute]
public ref class SqlCacheDependency sealed : public CacheDependency

Remarks

You can add items with dependencies to your application's cache with the [!:Cache.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.

Inheritance Hierarchy

System..::..Object
  Alachisoft.NCache.Runtime.Dependencies..::..CacheDependency
    Alachisoft.NCache.Runtime.Dependencies..::..SqlCacheDependency

See Also