Clears the errors for the row.
[Visual Basic] Public Sub ClearErrors() [C#] public void ClearErrors(); [C++] public: void ClearErrors(); [JScript] public function ClearErrors();
Use SetColumnError and GetColumnError to set and return errors for individual columns.
To determine if any errors exist for the columns collection, use the HasErrors method. Consequently, you can use the GetColumnsInError method to retrieve all of the columns with errors.
The following example gets the error description for each column in each DataTable of a DataSet. After printing each for each row, the ClearErrors method is called.
[Visual Basic]
Private Sub PrintAllErrs() Dim rowsInError() As DataRow Dim t As DataTable Dim ds As DataSet Dim i As Integer Dim c As DataColumn ds = DataSet1 For Each t in ds.Tables ' Test if the table has errors. If not, skip it. If t.HasErrors Then ' Get an array of all rows with errors. rowsInError = t.GetErrors ' Print the error of each column in each row. For i = 0 To UBound(rowsInError) For Each c In t.Columns Console.WriteLine(c.ColumnName, rowsInError(i).GetColumnError(c)) Next c ' Clear the row errors rowsInError(i).ClearErrors Next i End If Next t End Sub
DataRow Class | DataRow Members | System.Data Namespace | ColumnsCollection | GetColumnError | GetColumnsInError | HasErrors | SetColumnError