SqlCacheDependencyDatabase.PollTime 属性

定义

获取或设置 SqlCacheDependency 轮询数据库表更改情况的频率。Gets or sets the frequency with which the SqlCacheDependency polls the database table for changes.

public:
 property int PollTime { int get(); void set(int value); };
[System.Configuration.ConfigurationProperty("pollTime", DefaultValue=Mono.Cecil.CustomAttributeArgument)]
public int PollTime { get; set; }
[<System.Configuration.ConfigurationProperty("pollTime", DefaultValue=Mono.Cecil.CustomAttributeArgument)>]
member this.PollTime : int with get, set
Public Property PollTime As Integer

属性值

Int32

数据库轮询时间(以毫秒为单位)。The database polling time, in milliseconds.

属性

示例

下面的代码示例说明如何使用 PollTime 属性。The following code example shows how to use the PollTime property.


// 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 add databases 配置文件中节点的元素的属性。The PollTime property allows you to programmatically access and modify the pollTime attribute of an add element of the databases node in a configuration file.

在配置 ASP.NET 应用程序缓存中存储的项与特定 SQL Server 数据库表之间的关系后,类的实例将 SqlCacheDependency 监视该表,以便在表中的项发生更改时,该项会自动更新到缓存中或从缓存中删除。After you configure the relationship between an item stored in an ASP.NET application's cache and a specific SQL Server database table, an instance of the SqlCacheDependency class monitors the table so that when an item in the table changes, the item is automatically updated in or removed from the cache. 监视按指定的频率进行 PollTimeThe monitoring happens at the frequency specified by the PollTime.

适用于

另请参阅