NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

DataRow.GetColumnError (Int32)

Gets the error description for the column specified by index.

[Visual Basic]
Overloads Public Function GetColumnError( _
   ByVal columnIndex As Integer _
) As String
[C#]
public string GetColumnError(
   int columnIndex
);
[C++]
public: String* GetColumnError(
   int columnIndex
);
[JScript]
public function GetColumnError(
   columnIndex : int
) : String;

Parameters

columnIndex
The zero-based index of the column.

Return Value

The text of the error description.

Exceptions

Exception Type Condition
IndexOutOfRangeException The columnIndex argument is out of range.

Remarks

Use the SetColumnError method to set column errors.

To determine if any errors exist for the columns collection, use the HasErrors method. Consequently, you can use the GetColumnsInError method to retrieve all of the columns with errors.

To clear all errors for the columns collection, use the ClearErrors method.

Example [Visual Basic]

The following example sets and gets the error description for a new column in an existing System.WinForms.DataGrid control's DataTable.

[Visual Basic]

Dim myRow As DataRow
Dim t As DataTable
t = DataGrid1.DataSource.DataTable
myRow = t.NewRow
Dim ErrorString As String
ErrorString = "Replace this text."
' Use DataColumn.Contains to ensure the column exists
If myRow.DataTable.Columns.Contains(1) Then
   myRow.SetColumnError(1, ErrorString)
   Console.WriteLine(myRow.GetColumnError(1))
   ' Add the row
   t.Rows.Add(myRow)
End If

See Also

DataRow Class | DataRow Members | System.Data Namespace | DataRow.GetColumnError Overload List | ClearErrors | ColumnsCollection | Contains | DataColumn | Error | GetColumnsInError | HasErrors | RowError | SetColumnError