System.Data.DataSet の変更内容を、関連するデータベース内のデータに一致させる単一テーブルのコマンドを、自動的に生成します。
Public Class ULCommandBuilder Inherits System.Data.Common.DbCommandBuilder
public class ULCommandBuilder : System.Data.Common.DbCommandBuilder
継承されたメンバーを含む ULCommandBuilder クラスのすべてのメンバー。
名前 | 説明 |
---|---|
ULCommandBuilder オブジェクトを初期化します。 | |
|
![]() |
|
![]() |
データベースで削除処理を実行するのに必要な、自動的に生成された ULCommand オブジェクトを取得します。 | |
データベースで挿入処理を実行するのに必要な、自動的に生成された ULCommand オブジェクトを取得します。 | |
|
指定されたパラメーターの名前を @p# のフォーマットで返します。 |
|
関連する SQL 文のパラメーターのプレースホルダーを返します。 |
|
![]() |
データベースで更新処理を実行するのに必要な、自動的に生成された ULCommand オブジェクトを取得します。 | |
|
![]() ![]() ![]() ![]() ![]() |
|
カタログの大文字/小文字が正しい引用符なしの識別子が指定されると、識別子に埋め込まれる引用符を適切にエスケープして、正しい形式の引用符付き識別子を返します。 |
|
この ![]() |
|
![]() |
|
![]() ![]() ![]() |
|
引用符付き識別子が指定されると、識別子に埋め込まれた引用符を適切にアンエスケープして、正しい形式の引用符なしの識別子を返します。 |
|
![]() ![]() |
|
![]() |
|
![]() ![]() |
SQL 文が自動的に生成される ULDataAdapter オブジェクトを取得または設定します。 | |
|
スペースや予約語などの文字列が名前に含まれているデータベースオブジェクト (テーブルやカラムなど) を指定するときに使用する先頭の文字または文字列を取得または設定します。 |
|
スペースや予約語などの文字列が名前に含まれているデータベースオブジェクト (テーブルやカラムなど) を指定するときに使用する先頭の文字または文字列を取得または設定します。 |
|
スキーマ識別子とその他の識別子とを区切るセパレーターに使用する文字を取得または設定します。 |
|
UPDATE 文のすべてのカラム値が含まれるか、変更された値のみが含まれるかを指定します。 |
ULDataAdapter オブジェクトは、System.Data.DataSet の変更内容を関連するデータソース内のデータに一致させるために必要な SQL 文を、自動的には生成しません。ただし、ULDataAdapter オブジェクトの SelectCommand プロパティを設定すると単一テーブルを更新する SQL 文を自動的に生成するような、ULCommandBuilder オブジェクトを作成することはできます。これにより、設定していない追加の SQL 文が ULCommandBuilder オブジェクトによって生成されます。
次の例では、ULCommand オブジェクトを ULDataAdapter オブジェクトと ULConnection オブジェクトとともに使用して、データソースからローを選択します。この例では、接続文字列、クエリ文字列 (SQL SELECT 文)、データベーステーブル名を表す文字列を受け取り、次に ULCommandBuilder オブジェクトを作成します。
' Visual Basic Public Shared Function SelectULRows(ByVal connectionString As String, _ ByVal queryString As String, ByVal tableName As String) Dim connection As ULConnection = New ULConnection(connectionString) Dim adapter As ULDataAdapter = New ULDataAdapter() adapter.SelectCommand = New ULCommand(queryString, connection) Dim builder As ULCommandBuilder = New ULCommandBuilder(adapter) connection.Open() Dim dataSet As DataSet = New DataSet() adapter.Fill(dataSet, tableName) 'Insert code to modify data in DataSet. 'Without the ULCommandBuilder this line would fail adapter.Update(dataSet, tableName) Return dataSet End Function |
対応する C# 言語のコードを次に示します。
// C# public static DataSet SelectULRows(string connectionString, string queryString, string tableName) { using (ULConnection connection = new ULConnection(connectionString)) { ULDataAdapter adapter = new ULDataAdapter(); adapter.SelectCommand = new ULCommand(queryString, connection); ULCommandBuilder builder = new ULCommandBuilder(adapter); connection.Open(); DataSet dataSet = new DataSet(); adapter.Fill(dataSet, tableName); // Insert code to modify data in DataSet. // Without the ULCommandBuilder this line would fail adapter.Update(dataSet, tableName); return dataSet; } } |
ULCommandBuilder コンストラクター
GetDeleteCommand メソッド
GetInsertCommand メソッド
GetUpdateCommand メソッド
DataAdapter プロパティ
![]() |
DocCommentXchange で意見交換できます
|
Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1 |