SqlDependency コンストラクター

定義

SqlDependency クラスの新しいインスタンスを作成します。

オーバーロード

SqlDependency()

既定の設定を使用して、SqlDependency クラスの新しいインスタンスを作成します。

SqlDependency(SqlCommand)

SqlDependency クラスの新しいインスタンスを作成し、SqlCommand パラメーターに関連付けます。

SqlDependency(SqlCommand, String, Int32)

SqlDependency クラスの新しいインスタンスを作成し、SqlCommand パラメーターに関連付けます。通知オプションとタイムアウト値も指定します。

SqlDependency()

既定の設定を使用して、SqlDependency クラスの新しいインスタンスを作成します。

public:
 SqlDependency();
public SqlDependency ();
Public Sub New ()

注釈

コンストラクターは、既定の SqlDependency Service Broker サービス名とタイムアウトを使用して オブジェクトを初期化します。構築後のある時点で、 メソッドを AddCommandDependency 使用して、1 つ以上のコマンドをこの SqlDependency オブジェクトに関連付ける必要があります。

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

こちらもご覧ください

適用対象

SqlDependency(SqlCommand)

SqlDependency クラスの新しいインスタンスを作成し、SqlCommand パラメーターに関連付けます。

public:
 SqlDependency(System::Data::SqlClient::SqlCommand ^ command);
public SqlDependency (System.Data.SqlClient.SqlCommand command);
new System.Data.SqlClient.SqlDependency : System.Data.SqlClient.SqlCommand -> System.Data.SqlClient.SqlDependency
Public Sub New (command As SqlCommand)

パラメーター

command
SqlCommand

この SqlCommand オブジェクトに関連付ける SqlDependency オブジェクト。 このコンストラクターは、SqlNotificationRequest オブジェクトを設定し、コマンドに関連付けます。

例外

command パラメーターが NULL です。

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

注釈

内部的には、このコンストラクターは クラスのインスタンスを SqlNotificationRequest 作成し、それを オブジェクトに SqlCommand バインドします。

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

こちらもご覧ください

適用対象

SqlDependency(SqlCommand, String, Int32)

SqlDependency クラスの新しいインスタンスを作成し、SqlCommand パラメーターに関連付けます。通知オプションとタイムアウト値も指定します。

public:
 SqlDependency(System::Data::SqlClient::SqlCommand ^ command, System::String ^ options, int timeout);
public SqlDependency (System.Data.SqlClient.SqlCommand command, string options, int timeout);
new System.Data.SqlClient.SqlDependency : System.Data.SqlClient.SqlCommand * string * int -> System.Data.SqlClient.SqlDependency
Public Sub New (command As SqlCommand, options As String, timeout As Integer)

パラメーター

command
SqlCommand

この SqlCommand オブジェクトに関連付ける SqlDependency オブジェクト。 このコンストラクターは、SqlNotificationRequest オブジェクトを設定し、コマンドに関連付けます。

options
String

この依存関係で使用する通知要求オプションです。 既定のサービスを使用する場合は null

timeout
Int32

この通知のタイムアウト (秒)。 既定値は 0 で、サーバーのタイムアウトが使用されることを示します。

例外

command パラメーターが NULL です。

タイムアウト値が 0 未満です。

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

SQLCLR 内で SqlDependency インスタンスを作成しようとしました。

注釈

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

こちらもご覧ください

適用対象