本文整理汇总了VB.NET中System.Data.DataRow.RowError属性的典型用法代码示例。如果您正苦于以下问题:VB.NET DataRow.RowError属性的具体用法?VB.NET DataRow.RowError怎么用?VB.NET DataRow.RowError使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类System.Data.DataRow
的用法示例。
在下文中一共展示了DataRow.RowError属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: SetRowErrors
Private Sub SetRowErrors(ByVal table As DataTable)
' Set error text for ten rows.
Dim i As Integer
For i = 0 to 10
' Insert column 1 value into each error.
table.Rows(i).RowError = "ERROR: " & _
table.Rows(i)(1).ToString()
Next
' Get the DataSet for the table, and test it for errors.
Dim dataSet As DataSet = table.DataSet
TestForErrors(dataSet)
End Sub
Private Sub TestForErrors(ByVal dataSet As DataSet)
' Test for errors. If DataSet has errors,
' test each table.
If dataSet.HasErrors
Dim tempDataTable As DataTable
For Each tempDataTable in dataSet.Tables
' If the table has errors, then print them.
If(tempDataTable.HasErrors) Then
PrintRowErrs(tempDataTable)
End If
Next
' Refresh the DataGrid to see the error-marked rows.
DataGrid1.Refresh()
End If
End Sub
Private Sub PrintRowErrs(ByVal table As DataTable)
Dim row As DataRow
For Each row in table.Rows
If(row.HasErrors) Then
Console.WriteLine(row.RowError)
End If
Next
End Sub