本文整理汇总了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