DataTable.GetChanges メソッド ()とは? わかりやすく解説

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

DataTable.GetChanges メソッド ()

前回 DataTable を読み取るか、AcceptChanges を呼び出した以降にこのデータセットに対して行われたすべての変更格納されているこのデータセットコピー取得します

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

Public Function GetChanges As
 DataTable
Dim instance As DataTable
Dim returnValue As DataTable

returnValue = instance.GetChanges
public DataTable GetChanges ()
public:
DataTable^ GetChanges ()
public DataTable GetChanges ()
public function GetChanges () : DataTable

戻り値
この DataTable からの変更コピー変更ない場合null 参照 (Visual Basic では Nothing)。

解説解説
使用例使用例
Private Sub UpdateDataTable(table As
 DataTable, _
    myDataAdapter As OleDbDataAdapter)

    Dim xDataTable As DataTable = table.GetChanges()

    ' Check the DataTable for errors.
    If xDataTable.HasErrors Then
        ' Insert code to resolve errors.
    End If

    ' After fixing errors, update the database with the DataAdapter
 
    myDataAdapter.Update(xDataTable)
End Sub
private void UpdateDataTable(DataTable table,
 
    OleDbDataAdapter myDataAdapter)
{
    DataTable xDataTable = table.GetChanges();

    // Check the DataTable for errors.
    if (xDataTable.HasErrors)
    {
        // Insert code to resolve errors.
    }

    // After fixing errors, update the database with the DataAdapter
 
    myDataAdapter.Update(xDataTable);
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

DataTable.GetChanges メソッド (DataRowState)

前回 DataTable を読み取るか、AcceptChanges を呼び出した以降にこのデータセットに対して行われたすべての変更格納されているこのデータセットコピーを、DataRowState によってフィルタ処理した後で取得します

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

Public Function GetChanges ( _
    rowStates As DataRowState _
) As DataTable
Dim instance As DataTable
Dim rowStates As DataRowState
Dim returnValue As DataTable

returnValue = instance.GetChanges(rowStates)
public DataTable GetChanges (
    DataRowState rowStates
)
public:
DataTable^ GetChanges (
    DataRowState rowStates
)
public DataTable GetChanges (
    DataRowState rowStates
)
public function GetChanges (
    rowStates : DataRowState
) : DataTable

パラメータ

rowStates

DataRowState 値の 1 つ

戻り値
アクション実行した後、Merge使用して元のデータセットマージするために使用できるDataTableフィルタ処理後のコピー必要な DataRowState の行が見つからない場合、このメソッドnull 参照 (Visual Basic では Nothing) を返します

解説解説
使用例使用例
Private Sub ProcessDeletes(table As
 DataTable, _
    adapter As OleDbDataAdapter)

   Dim changeTable As DataTable = table.GetChanges(DataRowState.Deleted)

   ' Check the DataTable for errors.
   If table.HasErrors Then
      ' Insert code to resolve errors.
   End If

   ' After fixing errors, update the database with the DataAdapter 
   adapter.Update(changeTable)
End Sub
private void ProcessDeletes(DataTable table,
 
    OleDbDataAdapter adapter)
{
    DataTable changeTable = table.GetChanges(DataRowState.Deleted);

    // Check the DataTable for errors.
    if (changeTable.HasErrors)
    {
        // Insert code to resolve errors.
    }

    // After fixing errors, update the database with the DataAdapter
 
    adapter.Update(changeTable);
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

DataTable.GetChanges メソッド

前回 DataTable を読み取るか、AcceptChanges を呼び出した以降にこのデータセットに対して行われたすべての変更格納されているこのデータセットコピー取得します
オーバーロードの一覧オーバーロードの一覧

参照参照

関連項目

DataTable クラス
DataTable メンバ
System.Data 名前空間

その他の技術情報

DataTable の作成使用
DataTable の作成使用
DataTable の作成使用


このページでは「.NET Framework クラス ライブラリ リファレンス」からDataTable.GetChanges メソッド ()を検索した結果を表示しています。
Weblioに収録されているすべての辞書からDataTable.GetChanges メソッド ()を検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からDataTable.GetChanges メソッド () を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

カテゴリ一覧

すべての辞書の索引



Weblioのサービス

「DataTable.GetChanges メソッド ()」の関連用語


DataTable.GetChanges メソッド ()のお隣キーワード
検索ランキング

   

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



DataTable.GetChanges メソッド ()のページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS