本文整理匯總了VB.NET中System.Data.VersionNotFoundException類的典型用法代碼示例。如果您正苦於以下問題:VB.NET VersionNotFoundException類的具體用法?VB.NET VersionNotFoundException怎麽用?VB.NET VersionNotFoundException使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了VersionNotFoundException類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: DemonstrateVersionNotFoundException
Private Sub DemonstrateVersionNotFoundException()
' Create a DataTable with one column.
Dim table As New DataTable("NewTable")
Dim column As New DataColumn("NewColumn")
table.Columns.Add(column)
Dim newRow As DataRow
Dim i As Integer
For i = 0 To 9
newRow = table.NewRow()
newRow("NewColumn") = i
table.Rows.Add(newRow)
Next i
table.AcceptChanges()
Try
Console.WriteLine("Trying...")
Dim removedRow As DataRow = table.Rows(9)
removedRow.Delete()
removedRow.AcceptChanges()
' Try to get the Current row version.
Console.WriteLine(removedRow(0, DataRowVersion.Current))
Catch e As System.Data.VersionNotFoundException
Console.WriteLine("Current version of row not found.")
End Try
End Sub