SqlCacheDependencyAdmin::EnableNotifications Method (String^)
Enables SqlCacheDependency change notifications on the specified database.
Assembly: System.Web (in System.Web.dll)
Parameters
- connectionString
-
Type:
System::String^
A connection string used to connect to the SQL Server database.
| Exception | Condition |
|---|---|
| HttpException | A connection to the database could not be established. -or- The security context of the ASP.NET application does not have permission to connect to the database. -or- The security context of the ASP.NET application does not have permission to disable notifications for the database. |
The EnableNotifications method adds support for change notifications from the database specified in the connectionString parameter. Once you have run the EnableNotifications method, you must run the DisableNotifications method if you wish to disable change notifications for a database.
The following code example uses the EnableNotifications method to enable change notifications for the database specified by the connection string MyConnectionString.
For the full code required to run the example, see the Example section of the SqlCacheDependencyAdmin class overview topic.
Available since 2.0