SqlDependency コンストラクター

定義

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

オーバーロード

名前 説明
SqlDependency()

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

SqlDependency(SqlCommand)

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

SqlDependency(SqlCommand, String, Int32)

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

SqlDependency()

ソース:
System.Data.SqlClient.notsupported.cs

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

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

注釈

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

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

こちらもご覧ください

適用対象

SqlDependency(SqlCommand)

ソース:
System.Data.SqlClient.notsupported.cs

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 ステートメントでのみサポートされます。 詳細については、「SQL Server Service Broker」および「クエリ通知を使用した作業」を参照してください。

こちらもご覧ください

適用対象

SqlDependency(SqlCommand, String, Int32)

ソース:
System.Data.SqlClient.notsupported.cs

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 ステートメントでのみサポートされます。 詳細については、「SQL Server Service Broker」および「クエリ通知を使用した作業」を参照してください。

こちらもご覧ください

適用対象