Redigera

Dela via


SystemWebCachingSectionGroup.SqlCacheDependency Property

Definition

Gets the sqlCacheDependency section contained within the configuration.

public:
 property System::Web::Configuration::SqlCacheDependencySection ^ SqlCacheDependency { System::Web::Configuration::SqlCacheDependencySection ^ get(); };
[System.Configuration.ConfigurationProperty("sqlCacheDependency")]
public System.Web.Configuration.SqlCacheDependencySection SqlCacheDependency { get; }
[<System.Configuration.ConfigurationProperty("sqlCacheDependency")>]
member this.SqlCacheDependency : System.Web.Configuration.SqlCacheDependencySection
Public ReadOnly Property SqlCacheDependency As SqlCacheDependencySection

Property Value

The SqlCacheDependencySection object.

Attributes

Examples

The following code example shows how to obtain the SqlCacheDependencySection object from the configuration file of an existing Web application.


// Get the .<sqlCacheDependency> section
SqlCacheDependencySection sqlCacheDependency =
    cachingSectionGroup.SqlCacheDependency;

// Display one of its attributes.
msg = String.Format(
"Sql cache dependency enabled: {0}\n",
sqlCacheDependency.Enabled.ToString());

Console.Write(msg);
' Get the .<sqlCacheDependency> section
Dim sqlCacheDependency _
As SqlCacheDependencySection = _
cachingSectionGroup.SqlCacheDependency

' Display one of its attributes.
msg = String.Format( _
"Sql cache dependency enabled: {0}" + _
ControlChars.Lf, _
sqlCacheDependency.Enabled.ToString())

Console.Write(msg)

Remarks

The SqlCacheDependencySection object refers to the sqlCacheDependency section of the configuration file.

The SQL cache dependency establishes a relationship between an item stored in an ASP.NET application's cache and a specific SQL Server database table. An instance of the SqlCacheDependency class must monitor the table so that when the table changes the item will be automatically removed from the cache.

Applies to

See also