DataRow.GetColumnError 메서드

정의

열에 대한 오류 설명을 가져옵니다.

오버로드

GetColumnError(String)

지정된 이름을 가진 열의 오류 설명을 가져옵니다.

GetColumnError(DataColumn)

지정된 DataColumn의 오류 설명을 가져옵니다.

GetColumnError(Int32)

지정된 인덱스를 가진 열의 오류 설명을 가져옵니다.

GetColumnError(String)

지정된 이름을 가진 열의 오류 설명을 가져옵니다.

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

열 이름입니다.

반환

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)

지정된 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

매개 변수

반환

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)

지정된 인덱스를 가진 열의 오류 설명을 가져옵니다.

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

열의 인덱스(0부터 시작)입니다.

반환

String

오류 설명 텍스트를 반환합니다.

예외

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 사용합니다.

추가 정보

적용 대상