共用方式為


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 實例必須監視數據表,以便在數據表變更專案時自動從快取中移除。

適用於

另請參閱