Editare

Partajați prin


SqlChangeMonitor(SqlDependency) Constructor

Definition

Initializes a new instance of the SqlChangeMonitor class.

public:
 SqlChangeMonitor(System::Data::SqlClient::SqlDependency ^ dependency);
public SqlChangeMonitor (System.Data.SqlClient.SqlDependency dependency);
new System.Runtime.Caching.SqlChangeMonitor : System.Data.SqlClient.SqlDependency -> System.Runtime.Caching.SqlChangeMonitor
Public Sub New (dependency As SqlDependency)

Parameters

dependency
SqlDependency

An object that represents an ADO.NET SqlDependency object.

Exceptions

dependency is null.

Remarks

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.

Applies to