SqlDependency.AddCommandDependency(SqlCommand) Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Associe un SqlCommand objet à cette SqlDependency instance.
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)
Paramètres
- command
- SqlCommand
Objet SqlCommand contenant une instruction valide pour les notifications.
Exceptions
Le paramètre a la command valeur Null.
L’objet SqlCommand a déjà un SqlNotificationRequest objet affecté à sa Notification propriété et qui SqlNotificationRequest n’est pas associé à cette dépendance.
Remarques
Les notifications de requêtes sont prises en charge uniquement pour les instructions SELECT qui répondent à une liste d’exigences suivantes. Pour plus d’informations, consultez SQL Server Service Broker et Working avec notifications de requête.