データベースで変更される前の値を取得したい場合
DataTableにデータを格納した後に、データが変更されたか、変更されていないか判定したい時があると思います。
そのような場合には、DataRowVersionを引数に与えてやると変更前、変更後の値をダイレクトに取得することが可能になります。
VB.NET
' 変更前 「1000」
Dim originalString As String
originalString = row("cost", DataRowVersion.Original)
' 変更後 「9250」
Dim currentString As String
currentString = row("cost", DataRowVersion.Current)
C#
// 変更前 「1000」
string originalString = null;
originalString = row("cost", DataRowVersion.Original);
// 変更後 「9250」
string currentString = null;
currentString = row("cost", DataRowVersion.Current);