本文整理匯總了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