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配置文件中节点元素databases的属性add。
在配置存储在 ASP.NET 应用程序的缓存中的项与特定 SQL Server 数据库表之间的关系后,类的 SqlCacheDependency 实例会监视表,以便在表中的项发生更改时,该项会自动更新或从缓存中删除。 监视以指定的 PollTime频率进行。