Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

SqlDependency.OnChange Event

Occurs when a notification is received for any of the commands associated with this SqlDependency object.

Namespace:  System.Data.SqlClient
Assembly:  System.Data (in System.Data.dll)

public event OnChangeEventHandler OnChange

OnChange occurs when the results for the associated command change. If you are not using OnChange, you can check the HasChanges property to determine whether the query results have changed.

The OnChange event does not necessarily imply a change in the data. Other circumstances, such as time-out expired and failure to set the notification request, also generate OnChange.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft