asp.net.ph

DataRow.GetColumnError Method ( DataColumn )

System.Data Namespace   DataRow Class


Returns the error description of the specified DataColumn.

[ VB ]
Overloads Public Function GetColumnError ( _
   ByVal column As DataColumn _
) As String

[ C# ]
public string GetColumnError (
   DataColumn column
);

[ C++ ]
public: String* GetColumnError (
   DataColumn* column
);

[ JScript ]
public function GetColumnError (
   column : DataColumn
) : String;

Parameters

column
A DataColumn.

Return Value

The text of the error description.

Remarks

Use the SetColumnError method to set column errors.

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. Alternatively, the GetErrors method of the DataTable returns all rows with errors.

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

Example

The following example sets and gets an error description for a specified DataRow, using this constructor.

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

private void PrintColError ( DataRow myRow, DataColumn column ) {
   // print the error of a specified column.
   Response.Write ( myRow.GetColumnError ( column ) );
}
  C# VB

See Also

DataRow Members   DataRow.GetColumnError Overload List   ClearErrors   ColumnsCollection   Contains   DataColumn   GetColumnsInError   GetErrors   HasErrors   RowError   SetColumnError 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