SqlCacheDependencyDatabaseCollection.Add(SqlCacheDependencyDatabase) Method

Definition

Adds a SqlCacheDependencyDatabase object to the collection.

C#
public void Add(System.Web.Configuration.SqlCacheDependencyDatabase name);

Parameters

name
SqlCacheDependencyDatabase

The name of the SqlCacheDependencyDatabase object to add to the collection.

Exceptions

The SqlCacheDependencyDatabase object already exists in the collection or the collection is read only.

Examples

The following code example shows how to use the Add method.

C#
SqlCacheDependencyDatabase dbElement =
    new SqlCacheDependencyDatabase(
    "dataBase", "dataBaseElement", 500);
sqlCdds.Add(dbElement);

Remarks

Each SqlCacheDependencyDatabase in the collection must have a unique name.

Applies to

Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also