Export (0) Print
Expand All

SqlCacheDependencyAdmin.DisableTableForNotifications Method (String, String)

Disables SqlCacheDependency change notifications on a SQL Server database table.

Namespace:  System.Web.Caching
Assembly:  System.Web (in System.Web.dll)

public static void DisableTableForNotifications(
	string connectionString,
	string table
)

Parameters

connectionString
Type: System.String

A connection string used to connect to the SQL Server database.

table
Type: System.String

The database table on which to disable change notifications.

ExceptionCondition
DatabaseNotEnabledForNotificationException

The database is not enabled for change notifications.

ArgumentException

table is an empty string ("").

ArgumentNullException

table is null.

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 DisableTableForNotifications method disables change notifications for the table specified in the table parameter, which must be in the database specified in the connectionString parameter.

Once you have used the DisableTableForNotifications method to disable change notifications for a table, you must use one of the EnableTableForNotifications overloads if you wish to re-enable change notifications.

The following code example disables change notification on a table specified in the connection string MyConnectionString.

For the full code required to run the example, see the Example section of the SqlCacheDependencyAdmin class overview topic.

SqlCacheDependencyAdmin.EnableTableForNotifications(
  ConfigurationManager.ConnectionStrings["MyConnectionString"].ConnectionString,
  tableName.Text);

.NET Framework

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

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft