SqlCacheDependencySection 클래스
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
ASP.NET 애플리케이션에 대한 SQL 캐시 종속성을 구성합니다. 이 클래스는 상속할 수 없습니다.
public ref class SqlCacheDependencySection sealed : System::Configuration::ConfigurationSection
public sealed class SqlCacheDependencySection : System.Configuration.ConfigurationSection
type SqlCacheDependencySection = class
inherit ConfigurationSection
Public NotInheritable Class SqlCacheDependencySection
Inherits ConfigurationSection
- 상속
예제
다음 코드 예제에서는 기존 웹 애플리케이션의 SqlCacheDependencySection 구성 파일에서 개체를 가져오는 방법을 보여줍니다.
// Get the Web application configuration.
System.Configuration.Configuration webConfig =
WebConfigurationManager.OpenWebConfiguration("/aspnetTest");
// Get the section.
string configPath = "system.web/cache/sqlCacheDependency";
System.Web.Configuration.SqlCacheDependencySection sqlDs =
(System.Web.Configuration.SqlCacheDependencySection)webConfig.GetSection(
configPath);
' Get the Web application configuration.
Dim webConfig As System.Configuration.Configuration = _
WebConfigurationManager.OpenWebConfiguration( _
"/aspnetTest")
' Get the section.
Dim configPath As String = _
"system.web/cache/sqlCacheDependency"
Dim sqlDs _
As System.Web.Configuration.SqlCacheDependencySection = _
CType(webConfig.GetSection(configPath), _
System.Web.Configuration.SqlCacheDependencySection)
설명
이를 SqlCacheDependencySection 통해 구성 섹션의 요소에 프로그래밍 방식으로 액세스하고 수정할 sqlCacheDependencycache 수 있습니다.
SQL 캐시 종속성을 사용하면 캐시된 데이터를 원래 원본과 동기화할 수 있습니다. ASP.NET 애플리케이션의 캐시에 저장된 항목과 특정 SQL Server 데이터베이스 테이블 간의 관계를 구성한 후 SqlCacheDependency 클래스의 인스턴스는 테이블의 항목이 변경될 때 항목이 캐시에서 자동으로 제거되도록 테이블을 모니터링합니다.
이 요소의 설정은 개체의 테이블 기반 버전에만 영향을 미칩니다 SqlCacheDependency . SQL Server 2005 이상에서 사용되는 행 수준 SqlCacheDependency 개체는 이러한 설정의 영향을 받지 않습니다.
메모
값 SqlCacheDependencySection 이 있는 섹션 속성 AllowDefinition 에 정의된 제한 사항에 따라 구성 파일의 관련 섹션에 정보를 쓸 수 있습니다 MachineToApplication. 계층 구조에서 허용되지 않는 수준에서 구성 파일에 쓰려고 하면 파서에서 오류 메시지가 생성됩니다. 그러나 이 클래스를 사용하여 계층 구조의 모든 수준에서 구성 정보를 읽을 수 있습니다.
생성자
| Name | Description |
|---|---|
| SqlCacheDependencySection() |
SqlCacheDependencySection 클래스의 새 인스턴스를 초기화합니다. |