SystemWebCachingSectionGroup.SqlCacheDependency 属性

定义

获取配置中包含的 sqlCacheDependency 节。

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

属性值

SqlCacheDependencySection 对象。

属性

示例

下面的代码示例演示如何从现有 Web 应用程序的配置文件获取 SqlCacheDependencySection 对象。


// 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)

注解

SqlCacheDependencySection 对象是指配置文件中的 sqlCacheDependency 部分。

SQL 缓存依赖项在存储在 ASP.NET 应用程序的缓存中的项与特定的 SQL Server 数据库表之间建立关系。 类的 SqlCacheDependency 实例必须监视表,以便在表更改时自动从缓存中删除项。

适用于

另请参阅