asp.net.ph

DataRow.SetColumnError Method ( Int32, String )

System.Data Namespace   DataRow Class


Sets the error description for a column specified by index.

[ VB ]
Overloads Public Sub SetColumnError ( _
   ByVal columnIndex As Integer, _
   ByVal error As String _
)

[ C# ]
void SetColumnError (
   int columnIndex,
   string error
);

[ C++ ]
public: void SetColumnError (
   int columnIndex,
   String* error
);

[ JScript ]
public function SetColumnError (
   columnIndex : int,
   error : String
);

Parameters

columnIndex
The zero-based index of the column.
error
The error description.

Exceptions


Exception Type Condition
IndexOutOfRangeException Occurs when the columnIndex argument is out of range

Remarks

To examine error descriptions, use the GetColumnError method.

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.

To set a custom error description on the whole row, use the RowError property.

To clear all errors for the columns collection, use the ClearErrors method.

Example

The following example sets an error description for a specified DataRow.

private void SetColError ( DataRow myRow, int colIndex ) {
   string errorString = "Your error text here.";
   // set the error for the specified column of the row.
   myRow.SetColumnError ( colIndex, errorString );
}
  C# VB

See Also

DataRow Members   DataRow.SetColumnError Overload List   GetColumnError   GetColumnsInError   HasErrors   RowError Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph