SystemWebCachingSectionGroup.SqlCacheDependency Propriété

Définition

Obtient la sqlCacheDependency section contenue dans la configuration.

public:
 property System::Web::Configuration::SqlCacheDependencySection ^ SqlCacheDependency { System::Web::Configuration::SqlCacheDependencySection ^ get(); };
[System.Configuration.ConfigurationProperty("sqlCacheDependency")]
public System.Web.Configuration.SqlCacheDependencySection SqlCacheDependency { get; }
[<System.Configuration.ConfigurationProperty("sqlCacheDependency")>]
member this.SqlCacheDependency : System.Web.Configuration.SqlCacheDependencySection
Public ReadOnly Property SqlCacheDependency As SqlCacheDependencySection

Valeur de propriété

Objet SqlCacheDependencySection.

Attributs

Exemples

L’exemple de code suivant montre comment obtenir l’objet SqlCacheDependencySection à partir du fichier de configuration d’une application web existante.


// Get the .<sqlCacheDependency> section
SqlCacheDependencySection sqlCacheDependency =
    cachingSectionGroup.SqlCacheDependency;

// Display one of its attributes.
msg = String.Format(
"Sql cache dependency enabled: {0}\n",
sqlCacheDependency.Enabled.ToString());

Console.Write(msg);
' Get the .<sqlCacheDependency> section
Dim sqlCacheDependency _
As SqlCacheDependencySection = _
cachingSectionGroup.SqlCacheDependency

' Display one of its attributes.
msg = String.Format( _
"Sql cache dependency enabled: {0}" + _
ControlChars.Lf, _
sqlCacheDependency.Enabled.ToString())

Console.Write(msg)

Remarques

L’objet SqlCacheDependencySection fait référence à la sqlCacheDependency section du fichier de configuration.

La dépendance de cache SQL établit une relation entre un élément stocké dans le cache d'une application ASP.NET et une table de base de données SQL Server spécifique. Une instance de la SqlCacheDependency classe doit surveiller la table afin que lorsque la table modifie l’élément soit automatiquement supprimée du cache.

S’applique à

Voir aussi