SqlDependency.AddCommandDependency(SqlCommand) Metodo

Definizione

Associa un SqlCommand oggetto a questa SqlDependency istanza.

public:
 void AddCommandDependency(System::Data::SqlClient::SqlCommand ^ command);
public void AddCommandDependency(System.Data.SqlClient.SqlCommand command);
member this.AddCommandDependency : System.Data.SqlClient.SqlCommand -> unit
Public Sub AddCommandDependency (command As SqlCommand)

Parametri

command
SqlCommand

Oggetto SqlCommand contenente un'istruzione valida per le notifiche.

Eccezioni

Il command parametro è null.

L'oggetto SqlCommand dispone già di un SqlNotificationRequest oggetto assegnato alla relativa Notification proprietà e che SqlNotificationRequest non è associato a questa dipendenza.

Commenti

Le notifiche delle query sono supportate solo per le istruzioni SELECT che soddisfano un elenco di requisiti specifici. Per altre informazioni, vedere SQL Server Service Broker e Working with Query Notifications.

Si applica a

Vedi anche