SqlPipe.SendResultsRow メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > SqlPipe.SendResultsRow メソッドの意味・解説 

SqlPipe.SendResultsRow メソッド

メモ : このメソッドは、.NET Framework version 2.0 で新しく追加されたものです。

単一行のデータをクライアントに返します。

名前空間: Microsoft.SqlServer.Server
アセンブリ: System.Data (system.data.dll 内)
構文構文

Public Sub SendResultsRow ( _
    record As SqlDataRecord _
)
Dim instance As SqlPipe
Dim record As SqlDataRecord

instance.SendResultsRow(record)
public void SendResultsRow (
    SqlDataRecord record
)
public:
void SendResultsRow (
    SqlDataRecord^ record
)
public void SendResultsRow (
    SqlDataRecord record
)
public function SendResultsRow (
    record : SqlDataRecord
)

パラメータ

record

クライアントに送信する行の列値を含む SqlDataRecord オブジェクト。このレコードのスキーマは、SendResultsStart メソッドに渡した SqlDataRecord のメタデータが定義するスキーマと一致している必要があります。

例外例外
例外の種類条件

ArgumentNullException

record が null 参照 (Visual Basic では Nothing) です。

InvalidOperationException

SendResultsStart メソッドがまだ呼び出されていません。

解説解説
使用例使用例

次の例では、新しい SqlDataRecord と、その SqlMetaData オブジェクトを作成します。さらに、SendResultsStart メソッドで結果セットの先頭を宣言し、サンプルのデータを含むレコードを、SendResultsRow メソッドでクライアントに返した後、結果セットの最後に到達したことを、SendResultsEnd メソッドを使って示しています。

<Microsoft.SqlServer.Server.SqlProcedure()> _
Public Shared Sub StoredProcReturnResultSet()

    ' Create the record and specify the metadata for the columns.
    Dim record As New SqlDataRecord(
 _
        New SqlMetaData("col1",
 SqlDbType.NVarChar, 100), _
        New SqlMetaData("col2",
 SqlDbType.Int))

    ' Mark the begining of the result-set.
    SqlContext.Pipe.SendResultsStart(record)

    ' Send 10 rows back to the client.
    Dim i As Integer
    For i = 0 To 9

        ' Set values for each column in the row.
        record.SetString(0, "row " & i.ToString())
        record.SetInt32(1, i)

        ' Send the row back to the client.
        SqlContext.Pipe.SendResultsRow(record)
    Next

    ' Mark the end of the result-set.
    SqlContext.Pipe.SendResultsEnd()
End Sub
[Microsoft.SqlServer.Server.SqlProcedure]
public static void StoredProcReturnResultSet()
{
    // Create the record and specify the metadata for the columns.
    SqlDataRecord record = new SqlDataRecord(
        new SqlMetaData("col1", SqlDbType.NVarChar,
 100),
        new SqlMetaData("col2", SqlDbType.Int));

    // Mark the begining of the result-set.
    SqlContext.Pipe.SendResultsStart(record);

    // Send 10 rows back to the client.
    for (int i = 0; i < 10; i++)
    {
        // Set values for each column in the row.
        record.SetString(0, "row " + i.ToString());
        record.SetInt32(1, i);

        // Send the row back to the client.
        SqlContext.Pipe.SendResultsRow(record);
    }

    // Mark the end of the result-set.
    SqlContext.Pipe.SendResultsEnd();
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
SqlPipe クラス
SqlPipe メンバ
Microsoft.SqlServer.Server 名前空間
SendResultsStart
SendResultsEnd



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

SqlPipe.SendResultsRow メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



SqlPipe.SendResultsRow メソッドのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS