DataRow.GetColumnsInError Method ()


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets an array of columns that have errors.

Namespace:   System.Data
Assembly:  System.Data (in System.Data.dll)

member GetColumnsInError : unit -> DataColumn[]

Return Value

Type: System.Data.DataColumn[]

An array of DataColumn objects that contain errors.

The GetColumnsInError lets you reduce the number of DataColumn objects that must be processed for errors by returning only those columns that have an error. Errors can be set to individual columns with the SetColumnError method. To further reduce the number of processing, examine the HasErrors property of the DataRow class to determine whether a DataRow has errors before invoking GetColumnsInError.

Use the ClearErrors method to clear all errors on the row. This includes the RowError.

The following example uses the HasErrors to look for errors. If the row has errors, the GetColumnsInError method returns the array of columns with errors that can then be resolved. The ClearErrors method is then called to clear all errors.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top