OutputCacheProfile.SqlDependency 属性
定义
获取或设置 SqlDependency 属性。Gets or sets the SqlDependency property.
public:
property System::String ^ SqlDependency { System::String ^ get(); void set(System::String ^ value); };
[System.Configuration.ConfigurationProperty("sqlDependency")]
public string SqlDependency { get; set; }
[<System.Configuration.ConfigurationProperty("sqlDependency")>]
member this.SqlDependency : string with get, set
Public Property SqlDependency As String
属性值
SqlDependency 值。The SqlDependency value.
- 属性
示例
下面的代码示例说明如何使用 SqlDependency 属性。The following code example shows how to use the SqlDependency property.
// Get the current SqlDependency.
String sqlDependencyValue =
outputCacheProfile.SqlDependency;
// Set the SqlDependency.
outputCacheProfile.SqlDependency =
string.Empty;
' Get the current SqlDependency.
Dim sqlDependencyValue As String = _
outputCacheProfile.SqlDependency
' Set the SqlDependency.
outputCacheProfile.SqlDependency = _
String.Empty
注解
SqlDependency定义 Web 应用程序和 SQL Server 的实例之间的关系,允许检测服务器上数据的更改。The SqlDependency defines a relationship between a Web application and an instance of SQL Server, allowing the detection of changes in the data at the server. SqlDependency确保每次从缓存中删除输出缓存的页时,它们所依赖的 SQL 表都已更改。The SqlDependency ensures that output cached pages are removed from the cache whenever the SQL table on which they depend changes.
备注
SqlCacheDependency类监视表,以便在表发生更改时,将自动从缓存中删除该项。The SqlCacheDependency class monitors the table so that when the table changes, the item will be automatically removed from the Cache. 此类不能被继承。This class cannot be inherited.