.NET Framework Class Library DataRow..::.GetColumnError Method (Int32) Gets the error description for the column specified by index.
Namespace:
System.Data
Assembly:
System.Data (in System.Data.dll)

Syntax
Public Function GetColumnError ( _
columnIndex As Integer _
) As String
public string GetColumnError(
int columnIndex
)
public:
String^ GetColumnError(
int columnIndex
)
member GetColumnError :
columnIndex:int -> string

Exceptions

Remarks
Use the SetColumnError method to set column errors. To determine whether any errors exist for the columns collection, use the HasErrors method. Consequently, you can use the GetColumnsInError method to retrieve all the columns with errors. To clear all errors for the columns collection, use the ClearErrors method.

Examples
The following example sets an error description for a specified DataRow.
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
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));
}

Version Information
.NET FrameworkSupported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0 .NET Framework Client ProfileSupported in: 4, 3.5 SP1

Platforms
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role not supported), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

See Also
|
Biblioteca de clases de .NET Framework DataRow..::.GetColumnError (Método) (Int32) Obtiene la descripción de error para la columna especificada mediante un índice.
Espacio de nombres:
System.Data
Ensamblado:
System.Data (en System.Data.dll)

Sintaxis
Public Function GetColumnError ( _
columnIndex As Integer _
) As String
public string GetColumnError(
int columnIndex
)
public:
String^ GetColumnError(
int columnIndex
)
member GetColumnError :
columnIndex:int -> string

Excepciones

Comentarios
Utilice el método SetColumnError para establecer errores de columna. Para determinar si existen errores en la colección de columnas, utilice el método HasErrors. Por tanto, puede utilizar el método GetColumnsInError para recuperar todas las columnas con errores. Para borrar todos los errores de la colección de columnas, utilice el método ClearErrors.

Ejemplos
En el ejemplo siguiente se establece una descripción de error para un DataRow especificado.
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
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));
}

Información de versión
.NET FrameworkCompatible con: 4, 3.5, 3.0, 2.0, 1.1, 1.0 .NET Framework Client ProfileCompatible con: 4, 3.5 SP1

Plataformas
Windows 7, Windows Vista SP1 o posterior, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (no se admite Server Core), Windows Server 2008 R2 (se admite Server Core con SP1 o posterior), Windows Server 2003 SP2
.NET Framework no admite todas las versiones de todas las plataformas. Para obtener una lista de las versiones compatibles, vea Requisitos de sistema de .NET Framework.

Vea también
|