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

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

DataRow.HasVersion メソッド

指定したバージョン存在するかどうかを示す値を取得します

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

Public Function HasVersion ( _
    version As DataRowVersion _
) As Boolean
Dim instance As DataRow
Dim version As DataRowVersion
Dim returnValue As Boolean

returnValue = instance.HasVersion(version)
public bool HasVersion (
    DataRowVersion version
)
public:
bool HasVersion (
    DataRowVersion version
)
public boolean HasVersion (
    DataRowVersion version
)
public function HasVersion (
    version : DataRowVersion
) : boolean

パラメータ

version

行のバージョン指定する DataRowVersion 値の 1 つ

戻り値
指定したバージョン存在する場合trueそれ以外場合false

解説解説
使用例使用例

HasVersion メソッド使用して、列の現在の値と提示した値が同じかどうか確認する例を次に示します。列の現在の値と提示した値が同じ場合は、編集キャンセルされます。それ以外場合は、AcceptChanges メソッド呼び出されて、編集終了します

Private Sub CheckVersionBeforeAccept()
    ' Assuming the DataGrid is bound to a DataTable.
    Dim table As DataTable = CType(DataGrid1.DataSource,
 DataTable)
    Dim row As DataRow = table.Rows(DataGrid1.CurrentCell.RowNumber)
    row.BeginEdit
    row(1) = Edit1.Text
    If row.HasVersion(datarowversion.Proposed) Then
       If row(1, DataRowVersion.Current) Is
 _
            row(1, DataRowversion.Proposed) Then
          Console.WriteLine("The original and the proposed are
 the same")
          row.CancelEdit
          Exit Sub
       Else
          row.AcceptChanges
       End If
    Else
       Console.WriteLine("No new values proposed")
    End If
End Sub
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DataRow クラス
DataRow メンバ
System.Data 名前空間
AcceptChanges
BeginEdit
CancelEdit
Item
GetChildRows
GetParentRows
EndEdit
RowState


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

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

辞書ショートカット

すべての辞書の索引

「DataRow.HasVersion メソッド」の関連用語

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

   

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



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

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

©2025 GRAS Group, Inc.RSS