SqlCacheDependencyDatabase.PollTime 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定輪詢資料庫資料表變更的頻率 SqlCacheDependency 。
public:
property int PollTime { int get(); void set(int value); };
[System.Configuration.ConfigurationProperty("pollTime", DefaultValue=60000)]
public int PollTime { get; set; }
[<System.Configuration.ConfigurationProperty("pollTime", DefaultValue=60000)>]
member this.PollTime : int with get, set
Public Property PollTime As Integer
屬性值
資料庫輪詢時間以毫秒計。
- 屬性
範例
以下程式碼範例說明如何使用該 PollTime 屬性。
// Get the current PollTime property value.
Int32 pollTimeValue = sqlCdd.PollTime;
// Set the PollTime property to 1000 milliseconds.
sqlCdd.PollTime = 1000;
' Get the current PollTime property value.
Dim pollTimeValue As Int32 = sqlCdd.PollTime
' Set the PollTime property to 1000 milliseconds.
sqlCdd.PollTime = 1000
備註
這個PollTime特性允許你程式化地存取並修改pollTime設定檔中節點元素adddatabases的屬性。
在你設定 ASP.NET 應用程式快取中某個項目與特定 SQL Server 資料庫資料表之間的關係後,該 SqlCacheDependency 類別的一個實例會監控該資料表,當資料表中的某個項目有變動時,該項目會自動在快取中更新或移除。 監聽頻率依據 PollTime。