OutputCacheProfile.SqlDependency Properti
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Mendapatkan atau mengatur SqlDependency properti.
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
Nilai Properti
Nilai SqlDependency.
- Atribut
Contoh
Contoh kode berikut menunjukkan cara menggunakan SqlDependency properti .
// 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
Keterangan
SqlDependency menentukan hubungan antara aplikasi Web dan instans SQL Server, memungkinkan deteksi perubahan data di server. SqlDependency memastikan bahwa halaman cache output dihapus dari cache setiap kali tabel SQL bergantung pada perubahan.
Nota
Kelas SqlCacheDependency memantau tabel sehingga ketika tabel berubah, item akan dihapus secara otomatis dari Cache. Kelas ini tidak dapat diwariskan.