SqlChangeMonitor Constructor (SqlDependency^)
.NET Framework (current version)
Initializes a new instance of the SqlChangeMonitor class.
Assembly: System.Runtime.Caching (in System.Runtime.Caching.dll)
Parameters
- dependency
-
Type:
System.Data.SqlClient::SqlDependency^
An object that represents an ADO.NET SqlDependency object.
| Exception | Condition |
|---|---|
| ArgumentNullException | dependency is null. |
The SqlChangeMonitor method binds the OnChange event of the object in dependency to the OnChanged method handler. This enables the change monitor to receive notification of changes in SQL Server databases.
When you invoke the SqlChangeMonitor constructor, you must pass a SqlDependency object as a parameter. When you create a SqlDependency object, you must pass a SqlCommand parameter to the constructor. The constructor for SqlDependency class lets you specify optional information for configuring the SqlDependency instance.
.NET Framework
Available since 4.0
Available since 4.0
Show: