DataRow の現在のバージョンの説明を取得します。
Public ReadOnly Property RowVersion As DataRowVersion
[C#]
public DataRowVersion RowVersion {get;}
[C++]
public: __property DataRowVersion get_RowVersion();
[JScript]
public function get RowVersion() : DataRowVersion;
プロパティ値
DataRowVersion 値の 1 つ。RowVersion プロパティに使用できる値は、 Default 、 Original 、 Current 、および Proposed です。
解説
詳細については、「 DataRowVersion 」を参照してください。
使用例
[Visual Basic, C#, C++] RowVersion プロパティを使用して、 DataRowView 内の行の状態を確認する例を次に示します。
Private Sub ShowModifiedCurrentRows()
Dim dv As DataView = CType(dataGrid1.DataSource, DataView)
' Set the filter to display only those rows that were modified.
dv.RowStateFilter = DataViewRowState.ModifiedCurrent
' Change the value of the CompanyName column for each modified row.
Dim drv As DataRowView
For Each drv In dv
Console.WriteLine(drv)
Next drv
End Sub
[C#]
private void ShowModifiedCurrentRows(){
DataView dv = (DataView) dataGrid1.DataSource;
// Set the filter to display only those rows that were modified.
dv.RowStateFilter=DataViewRowState.ModifiedCurrent;
// Change the value of the CompanyName column for each modified row.
foreach(DataRowView drv in dv){
Console.WriteLine(drv);
}
}
[C++]
private:
void ShowModifiedCurrentRows(){
DataView* dv = dynamic_cast<DataView*> (dataGrid1->DataSource);
// Set the filter to display only those rows that were modified.
dv->RowStateFilter=DataViewRowState::ModifiedCurrent;
// Change the value of the CompanyName column for each modified row.
System::Collections::IEnumerator* myEnum = dv->GetEnumerator();
while (myEnum->MoveNext())
{
DataRowView* drv = __try_cast<DataRowView*>(myEnum->Current);
Console::WriteLine(drv);
}
}
[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン をクリックします。
必要条件
プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ, .NET Compact Framework - Windows CE .NET
参照
DataRowView クラス | DataRowView メンバ | System.Data 名前空間 | AcceptChanges | BeginEdit | DataRowVersion | EndEdit