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;
- column
- A DataColumn.
The text of the error description.
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.
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 ) );
}
Private Sub SetColError ( ByVal myRow As DataRow, ByVal column As DataColumn )
Dim errorString As String
errorString = "Your error text here."
' set the error for the specified column of the row.
myRow.SetColumnError ( column, errorString )
End Sub
Private Sub PrintColError ( ByVal myRow As DataRow, ByVal column As DataColumn )
' print the error of a specified column.
Response.Write ( myRow.GetColumnError ( column ) )
End Sub |
|
C# |
VB |
DataRow Members DataRow.GetColumnError Overload List ClearErrors ColumnsCollection Contains DataColumn GetColumnsInError GetErrors HasErrors RowError SetColumnError