SystemWebCachingSectionGroup.SqlCacheDependency 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得組態內所含的 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
屬性值
- 屬性
範例
下列程式代碼範例示範如何從現有 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 實例必須監視數據表,以便在數據表變更專案時自動從快取中移除。