DataRow.GetColumnError Metoda

Definicja

Pobiera opis błędu dla kolumny.

Przeciążenia

GetColumnError(String)

Pobiera opis błędu dla kolumny określonej przez nazwę.

GetColumnError(DataColumn)

Pobiera opis błędu określonego DataColumnelementu .

GetColumnError(Int32)

Pobiera opis błędu dla kolumny określonej przez indeks.

GetColumnError(String)

Źródło:
DataRow.cs
Źródło:
DataRow.cs
Źródło:
DataRow.cs

Pobiera opis błędu dla kolumny określonej przez nazwę.

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

Parametry

columnName
String

Nazwa kolumny.

Zwraca

Tekst opisu błędu.

Przykłady

W poniższym przykładzie ustawiono opis błędu dla określonego DataRowelementu .

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

Uwagi

SetColumnError Użyj metody , aby ustawić błędy kolumn.

Aby określić, czy istnieją błędy dla kolekcji kolumn, użyj HasErrors metody . W związku z tym można użyć GetColumnsInError metody , aby pobrać wszystkie kolumny z błędami.

Aby wyczyścić wszystkie błędy dla kolekcji kolumn, użyj ClearErrors metody .

Zobacz też

Dotyczy

GetColumnError(DataColumn)

Źródło:
DataRow.cs
Źródło:
DataRow.cs
Źródło:
DataRow.cs

Pobiera opis błędu określonego DataColumnelementu .

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

Parametry

column
DataColumn

Klasa DataColumn.

Zwraca

Tekst opisu błędu.

Przykłady

W poniższym przykładzie ustawiono opis błędu dla określonego DataRowelementu .

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

Uwagi

SetColumnError Użyj metody , aby ustawić błędy kolumn.

Aby określić, czy istnieją błędy dla kolekcji kolumn, użyj HasErrors metody . W związku z tym można użyć GetColumnsInError metody , aby pobrać wszystkie kolumny z błędami. Alternatywnie GetErrors metoda metody DataTable zwraca wszystkie wiersze z błędami.

Aby wyczyścić wszystkie błędy dla kolekcji kolumn, użyj ClearErrors metody .

Zobacz też

Dotyczy

GetColumnError(Int32)

Źródło:
DataRow.cs
Źródło:
DataRow.cs
Źródło:
DataRow.cs

Pobiera opis błędu dla kolumny określonej przez indeks.

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

Parametry

columnIndex
Int32

Indeks oparty na zerze kolumny.

Zwraca

Tekst opisu błędu.

Wyjątki

Argument columnIndex jest poza zakresem.

Przykłady

W poniższym przykładzie ustawiono opis błędu dla określonego DataRowelementu .

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

Uwagi

SetColumnError Użyj metody , aby ustawić błędy kolumn.

Aby określić, czy istnieją błędy dla kolekcji kolumn, użyj HasErrors metody . W związku z tym można użyć GetColumnsInError metody , aby pobrać wszystkie kolumny z błędami.

Aby wyczyścić wszystkie błędy dla kolekcji kolumn, użyj ClearErrors metody .

Zobacz też

Dotyczy