DataRow.GetColumnError Metoda
Definice
Získá popis chyby pro sloupec.Gets the error description for a column.
Přetížení
GetColumnError(String) |
Získá popis chyby pro sloupec zadaný pomocí názvu.Gets the error description for a column, specified by name. |
GetColumnError(DataColumn) |
Získá popis chyby určeného DataColumntypu.Gets the error description of the specified DataColumn. |
GetColumnError(Int32) |
Získá popis chyby pro sloupec určený indexem.Gets the error description for the column specified by index. |
GetColumnError(String)
Získá popis chyby pro sloupec zadaný pomocí názvu.Gets the error description for a column, specified by name.
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
Název sloupceThe name of the column.
Návraty
Text popisu chybyThe text of the error description.
Příklady
Následující příklad nastaví popis chyby pro zadanou DataRowhodnotu.The following example sets an error description for a specified 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
Poznámky
SetColumnError Použijte metodu k nastavení chyb sloupce.Use the SetColumnError method to set column errors.
Chcete-li zjistit, zda existují nějaké chyby pro kolekci sloupců, HasErrors použijte metodu.To determine whether any errors exist for the columns collection, use the HasErrors method. V důsledku toho můžete použít GetColumnsInError metodu pro načtení všech sloupců s chybami.Consequently, you can use the GetColumnsInError method to retrieve all the columns with errors.
Chcete-li vymazat všechny chyby pro kolekci sloupců, použijte ClearErrors metodu.To clear all errors for the columns collection, use the ClearErrors method.
Viz také
GetColumnError(DataColumn)
Získá popis chyby určeného DataColumntypu.Gets the error description of the specified 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
Parametry
- column
- DataColumn
A DataColumn.A DataColumn.
Návraty
Text popisu chybyThe text of the error description.
Příklady
Následující příklad nastaví popis chyby pro zadanou DataRowhodnotu.The following example sets an error description for a specified 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
Poznámky
SetColumnError Použijte metodu k nastavení chyb sloupce.Use the SetColumnError method to set column errors.
Chcete-li zjistit, zda existují nějaké chyby pro kolekci sloupců, HasErrors použijte metodu.To determine whether any errors exist for the columns collection, use the HasErrors method. V důsledku toho můžete použít GetColumnsInError metodu pro načtení všech sloupců s chybami.Consequently, you can use the GetColumnsInError method to retrieve all the columns with errors. Alternativně DataTable Metoda vrátí všechny řádky s chybami. GetErrorsAlternatively, the GetErrors method of the DataTable returns all rows with errors.
Chcete-li vymazat všechny chyby pro kolekci sloupců, použijte ClearErrors metodu.To clear all errors for the columns collection, use the ClearErrors method.
Viz také
GetColumnError(Int32)
Získá popis chyby pro sloupec určený indexem.Gets the error description for the column specified by 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
Parametry
- columnIndex
- Int32
Index sloupce počítaný od nulyThe zero-based index of the column.
Návraty
Text popisu chybyThe text of the error description.
Výjimky
columnIndex
Argument je mimo rozsah.The columnIndex
argument is out of range.
Příklady
Následující příklad nastaví popis chyby pro zadanou DataRowhodnotu.The following example sets an error description for a specified 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
Poznámky
SetColumnError Použijte metodu k nastavení chyb sloupce.Use the SetColumnError method to set column errors.
Chcete-li zjistit, zda existují nějaké chyby pro kolekci sloupců, HasErrors použijte metodu.To determine whether any errors exist for the columns collection, use the HasErrors method. V důsledku toho můžete použít GetColumnsInError metodu pro načtení všech sloupců s chybami.Consequently, you can use the GetColumnsInError method to retrieve all the columns with errors.
Chcete-li vymazat všechny chyby pro kolekci sloupců, použijte ClearErrors metodu.To clear all errors for the columns collection, use the ClearErrors method.