Επεξεργασία

Κοινή χρήση μέσω


SqlCacheDependencyAdmin.DisableTableForNotifications Method

Definition

Disables SqlCacheDependency change notifications on a SQL Server database table or an array of database tables.

Overloads

DisableTableForNotifications(String, String)

Disables SqlCacheDependency change notifications on a SQL Server database table.

DisableTableForNotifications(String, String[])

Disables SqlCacheDependency change notifications on an array of SQL Server database tables.

DisableTableForNotifications(String, String)

Disables SqlCacheDependency change notifications on a SQL Server database table.

public:
 static void DisableTableForNotifications(System::String ^ connectionString, System::String ^ table);
public static void DisableTableForNotifications (string connectionString, string table);
static member DisableTableForNotifications : string * string -> unit
Public Shared Sub DisableTableForNotifications (connectionString As String, table As String)

Parameters

connectionString
String

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

table
String

The database table on which to disable change notifications.

Exceptions

The database is not enabled for change notifications.

table is an empty string ("").

table is null.

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.

Examples

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);
SqlCacheDependencyAdmin.EnableTableForNotifications( _
  ConfigurationManager.ConnectionStrings("MyConnectionString").ConnectionString, _
  tableName.Text)

Remarks

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.

Applies to

DisableTableForNotifications(String, String[])

Disables SqlCacheDependency change notifications on an array of SQL Server database tables.

public:
 static void DisableTableForNotifications(System::String ^ connectionString, cli::array <System::String ^> ^ tables);
public static void DisableTableForNotifications (string connectionString, string[] tables);
static member DisableTableForNotifications : string * string[] -> unit
Public Shared Sub DisableTableForNotifications (connectionString As String, tables As String())

Parameters

connectionString
String

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

tables
String[]

The array of SQL Server database tables on which to disable change notifications.

Exceptions

The database is not enabled for change notifications.

One of the values in the tables parameter is null.

-or-

One of the values in the tables parameter is an empty string ("").

tables is null.

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.

Remarks

The DisableTableForNotifications method removes change notifications from the tables specified in the tables parameter. These tables must be in the database specified in the connectionString parameter.

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

Applies to