DataRow.GetColumnError Метод

Определение

Получает описание ошибки для столбца.

Перегрузки

GetColumnError(String)

Получает описание ошибки для столбца, указанного по имени.

GetColumnError(DataColumn)

Получает описание ошибки указанного объекта DataColumn.

GetColumnError(Int32)

Получает описание ошибки для столбца, указанного по индексу.

GetColumnError(String)

Исходный код:
DataRow.cs
Исходный код:
DataRow.cs
Исходный код:
DataRow.cs

Получает описание ошибки для столбца, указанного по имени.

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

Параметры

columnName
String

Имя столбца.

Возвращаемое значение

Текст описания ошибки.

Примеры

В следующем примере задается описание ошибки для указанного 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

Комментарии

Используйте метод для SetColumnError задания ошибок столбцов.

Чтобы определить, существуют ли ошибки для коллекции столбцов, используйте HasErrors метод . Следовательно, можно использовать метод для GetColumnsInError извлечения всех столбцов с ошибками.

Чтобы удалить все ошибки для коллекции столбцов, используйте ClearErrors метод .

См. также раздел

Применяется к

GetColumnError(DataColumn)

Исходный код:
DataRow.cs
Исходный код:
DataRow.cs
Исходный код:
DataRow.cs

Получает описание ошибки указанного объекта 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

Параметры

Возвращаемое значение

Текст описания ошибки.

Примеры

В следующем примере задается описание ошибки для указанного 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

Комментарии

Используйте метод для SetColumnError задания ошибок столбцов.

Чтобы определить, существуют ли ошибки для коллекции столбцов, используйте HasErrors метод . Следовательно, можно использовать метод для GetColumnsInError извлечения всех столбцов с ошибками. Кроме того, GetErrors метод DataTable объекта возвращает все строки с ошибками.

Чтобы удалить все ошибки для коллекции столбцов, используйте ClearErrors метод .

См. также раздел

Применяется к

GetColumnError(Int32)

Исходный код:
DataRow.cs
Исходный код:
DataRow.cs
Исходный код:
DataRow.cs

Получает описание ошибки для столбца, указанного по индексу.

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

Параметры

columnIndex
Int32

Индекс столбца (с нуля).

Возвращаемое значение

Текст описания ошибки.

Исключения

Аргумент columnIndex вне диапазона.

Примеры

В следующем примере задается описание ошибки для указанного 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

Комментарии

Используйте метод для SetColumnError задания ошибок столбцов.

Чтобы определить, существуют ли ошибки для коллекции столбцов, используйте HasErrors метод . Следовательно, можно использовать метод для GetColumnsInError извлечения всех столбцов с ошибками.

Чтобы удалить все ошибки для коллекции столбцов, используйте ClearErrors метод .

См. также раздел

Применяется к