This documentation is archived and is not being maintained.

DataRow.GetColumnError Method

Gets the error description for a column.

Overload List

Gets the error description of the specified DataColumn.

Supported by the .NET Compact Framework.

[Visual Basic] Overloads Public Function GetColumnError(DataColumn) As String
[C#] public string GetColumnError(DataColumn);
[C++] public: String* GetColumnError(DataColumn*);
[JScript] public function GetColumnError(DataColumn) : String;

Gets the error description for the column specified by index.

Supported by the .NET Compact Framework.

[Visual Basic] Overloads Public Function GetColumnError(Integer) As String
[C#] public string GetColumnError(int);
[C++] public: String* GetColumnError(int);
[JScript] public function GetColumnError(int) : String;

Gets the error description for a column, specified by name.

Supported by the .NET Compact Framework.

[Visual Basic] Overloads Public Function GetColumnError(String) As String
[C#] public string GetColumnError(string);
[C++] public: String* GetColumnError(String*);
[JScript] public function GetColumnError(String) : String;

Example

[Visual Basic, C#, C++] The following example sets an error description for a specified DataRow.

[Visual Basic, C#, C++] Note   This example shows how to use one of the overloaded versions of GetColumnError. For other examples that might be available, see the individual overload topics.
[Visual Basic] 
Private Sub SetColError(ByVal myRow As DataRow, byVal ColIndex As Integer)
    Dim errorString As String 
    errorString = "Replace this text."
    ' Set the error for the specified column of the row.
    myRow.SetColumnError(ColIndex, errorString)
 End Sub
 
 Private Sub PrintColError(ByVal myRow As DataRow, byVal ColIndex As Integer)
    ' Print the error of a specified column.
    Console.WriteLine(myRow.GetColumnError(ColIndex))
 End Sub

[C#] 
private void SetColError(DataRow myRow, int ColIndex){
    string errorString;
    errorString = "Replace this text.";
    // Set the error for the specified column of the row.
    myRow.SetColumnError(ColIndex, errorString);
 }
 
 private void PrintColError(DataRow myRow, int ColIndex){
    // Print the error of a specified column.
    Console.WriteLine(myRow.GetColumnError(ColIndex));
 }

[C++] 
private:
void SetColError(DataRow* myRow, int ColIndex){
    String* errorString;
    errorString = S"Replace this text.";
    // Set the error for the specified column of the row.
    myRow->SetColumnError(ColIndex, errorString);
 }
 
 void PrintColError(DataRow* myRow, int ColIndex){
    // Print the error of a specified column.
    Console::WriteLine(myRow->GetColumnError(ColIndex));
 }

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

See Also

DataRow Class | DataRow Members | System.Data Namespace

Show: