DataRow.GetColumnError Methode

Definitie

Hiermee wordt de foutbeschrijving voor een kolom weergegeven.

Overloads

Name Description
GetColumnError(String)

Hiermee wordt de foutbeschrijving voor een kolom, opgegeven op naam, weergegeven.

GetColumnError(DataColumn)

Hiermee wordt de foutbeschrijving van de opgegeven DataColumn.

GetColumnError(Int32)

Hiermee haalt u de foutbeschrijving op voor de kolom die is opgegeven door de index.

GetColumnError(String)

Bron:
DataRow.cs
Bron:
DataRow.cs
Bron:
DataRow.cs
Bron:
DataRow.cs
Bron:
DataRow.cs

Hiermee wordt de foutbeschrijving voor een kolom, opgegeven op naam, weergegeven.

public:
 System::String ^ GetColumnError(System::String ^ columnName);
public string GetColumnError(string columnName);
member this.GetColumnError : string -> string
Public Function GetColumnError (columnName As String) As String

Parameters

columnName
String

De naam van de kolom.

Retouren

De tekst van de foutbeschrijving.

Voorbeelden

In het volgende voorbeeld wordt een foutbeschrijving ingesteld voor een opgegeven DataRow.

private void SetColError(DataRow row, int columnIndex)
{
    string errorString = "Replace this text.";

    // Set the error for the specified column of the row.
    row.SetColumnError(columnIndex, errorString);
}

private void PrintColError(DataRow row, int columnIndex)
{
    // Print the error of a specified column.
    Console.WriteLine(row.GetColumnError(columnIndex));
}
Private Sub SetColError(ByVal row As DataRow, _
    byVal columnIndex As Integer)
    Dim errorString As String = "Replace this text."

    ' Set the error for the specified column of the row.
    row.SetColumnError(columnIndex, errorString)
End Sub
 
Private Sub PrintColError( _
    ByVal row As DataRow, byVal columnIndex As Integer)

    ' Print the error of a specified column.
    Console.WriteLine(row.GetColumnError(columnIndex))
End Sub

Opmerkingen

Gebruik de SetColumnError methode om kolomfouten in te stellen.

Gebruik de HasErrors methode om te bepalen of er fouten bestaan voor de verzameling kolommen. Daarom kunt u de GetColumnsInError methode gebruiken om alle kolommen met fouten op te halen.

Als u alle fouten voor de verzameling kolommen wilt wissen, gebruikt u de ClearErrors methode.

Zie ook

Van toepassing op

GetColumnError(DataColumn)

Bron:
DataRow.cs
Bron:
DataRow.cs
Bron:
DataRow.cs
Bron:
DataRow.cs
Bron:
DataRow.cs

Hiermee wordt de foutbeschrijving van de opgegeven DataColumn.

public:
 System::String ^ GetColumnError(System::Data::DataColumn ^ column);
public string GetColumnError(System.Data.DataColumn column);
member this.GetColumnError : System.Data.DataColumn -> string
Public Function GetColumnError (column As DataColumn) As String

Parameters

Retouren

De tekst van de foutbeschrijving.

Voorbeelden

In het volgende voorbeeld wordt een foutbeschrijving ingesteld voor een opgegeven DataRow.

private void SetColError(DataRow row, int columnIndex)
{
    string errorString = "Replace this text.";

    // Set the error for the specified column of the row.
    row.SetColumnError(columnIndex, errorString);
}

private void PrintColError(DataRow row, int columnIndex)
{
    // Print the error of a specified column.
    Console.WriteLine(row.GetColumnError(columnIndex));
}
Private Sub SetColError(ByVal row As DataRow, _
    byVal columnIndex As Integer)
    Dim errorString As String = "Replace this text."

    ' Set the error for the specified column of the row.
    row.SetColumnError(columnIndex, errorString)
End Sub
 
Private Sub PrintColError( _
    ByVal row As DataRow, byVal columnIndex As Integer)

    ' Print the error of a specified column.
    Console.WriteLine(row.GetColumnError(columnIndex))
End Sub

Opmerkingen

Gebruik de SetColumnError methode om kolomfouten in te stellen.

Gebruik de HasErrors methode om te bepalen of er fouten bestaan voor de verzameling kolommen. Daarom kunt u de GetColumnsInError methode gebruiken om alle kolommen met fouten op te halen. De methode van de GetErrors methode retourneert ook DataTable alle rijen met fouten.

Als u alle fouten voor de verzameling kolommen wilt wissen, gebruikt u de ClearErrors methode.

Zie ook

Van toepassing op

GetColumnError(Int32)

Bron:
DataRow.cs
Bron:
DataRow.cs
Bron:
DataRow.cs
Bron:
DataRow.cs
Bron:
DataRow.cs

Hiermee haalt u de foutbeschrijving op voor de kolom die is opgegeven door de index.

public:
 System::String ^ GetColumnError(int columnIndex);
public string GetColumnError(int columnIndex);
member this.GetColumnError : int -> string
Public Function GetColumnError (columnIndex As Integer) As String

Parameters

columnIndex
Int32

De op nul gebaseerde index van de kolom.

Retouren

De tekst van de foutbeschrijving.

Uitzonderingen

Het columnIndex argument valt buiten het bereik.

Voorbeelden

In het volgende voorbeeld wordt een foutbeschrijving ingesteld voor een opgegeven DataRow.

private void SetColError(DataRow row, int columnIndex)
{
    string errorString = "Replace this text.";

    // Set the error for the specified column of the row.
    row.SetColumnError(columnIndex, errorString);
}

private void PrintColError(DataRow row, int columnIndex)
{
    // Print the error of a specified column.
    Console.WriteLine(row.GetColumnError(columnIndex));
}
Private Sub SetColError(ByVal row As DataRow, _
    byVal columnIndex As Integer)
    Dim errorString As String = "Replace this text."

    ' Set the error for the specified column of the row.
    row.SetColumnError(columnIndex, errorString)
End Sub
 
Private Sub PrintColError( _
    ByVal row As DataRow, byVal columnIndex As Integer)

    ' Print the error of a specified column.
    Console.WriteLine(row.GetColumnError(columnIndex))
End Sub

Opmerkingen

Gebruik de SetColumnError methode om kolomfouten in te stellen.

Gebruik de HasErrors methode om te bepalen of er fouten bestaan voor de verzameling kolommen. Daarom kunt u de GetColumnsInError methode gebruiken om alle kolommen met fouten op te halen.

Als u alle fouten voor de verzameling kolommen wilt wissen, gebruikt u de ClearErrors methode.

Zie ook

Van toepassing op