asp.net.ph

DataRow.GetColumnError Method ( String )

System.Data Namespace   DataRow Class


Returns the error description for a column specified by name.

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

[ C# ]
public string GetColumnError (
   string columnName
);

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

[ JScript ]
public function GetColumnError (
   columnName : String
) : String;

Parameters

columnName
The name of the column.

Return Value

The text of the error description.

Remarks


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, string columnName ) {
   string errorString;
   errorString = "Your error text here.";
   // set the error for the specified column of the row.
   myRow.SetColumnError ( columnName, errorString );
}

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

See Also

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