OutputCacheProfile.SqlDependency Property

Gets or sets the SqlDependency property.

Namespace: System.Web.Configuration
Assembly: System.Web (in system.web.dll)

public string SqlDependency { get; set; }
/** @property */
public String get_SqlDependency ()

/** @property */
public void set_SqlDependency (String value)

public function get SqlDependency () : String

public function set SqlDependency (value : String)

Not applicable.

Property Value

The SqlDependency value.

The SqlDependency defines a relationship between a Web application and an instance of SQL Server, allowing the detection of changes in the data at the server. The SqlDependency ensures that output cached pages are removed from the cache whenever the SQL table on which they depend changes.


The SqlCacheDependency class monitors the table so that when the table changes, the item will be automatically removed from the Cache. This class cannot be inherited.

The following code example shows how to use the SqlDependency property.

// Get the current SqlDependency.
String sqlDependencyValue = 

// Set the SqlDependency.
outputCacheProfile.SqlDependency = 

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions