SqlDependency.AddCommandDependency(SqlCommand) メソッド

定義

SqlCommand オブジェクトをこのSqlDependency インスタンスに関連付けます。

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)

パラメーター

command
SqlCommand

通知に有効なステートメントを含む SqlCommand オブジェクト。

例外

command パラメーターは null です。

SqlCommand オブジェクトには、Notification プロパティに割り当てられているSqlNotificationRequest オブジェクトが既にあり、そのSqlNotificationRequestはこの依存関係に関連付けされていません。

注釈

クエリ通知は、特定の要件を満たす SELECT ステートメントでのみサポートされます。 詳細については、「SQL Server Service Broker」および「クエリ通知を使用した作業」を参照してください。

適用対象

こちらもご覧ください