RowError
StringrowError
= DataRow.RowError; DataRow.RowError =rowError
;
Gets or sets a value containing the error description text that
applies to the entire DataRow
.
The following example shows how to set the error text for a
DataRow
:
DataTable dt = new DataTable(); DataColumn col = dt.Columns.Add("MyColumn", typeof(System.String)); DataRow row = dt.NewRow(); row.RowError = "This row has an error.";
The RowError
property can be set when processing
modified data against the business rules. Alternatively, when the
Update( )
method of the
DataAdapter
is called and fails and the
ContinueUpdateOnError
property of the
DataAdapter
is set to true
, the
HasErrors
property of the row is set to
true
and the RowError
property
is set to the error message. The RowUpdated
event
handler can be used to determine the status of the update attempt and
set the error text for the row as necessary.
Use the GetColumnError( )
and
SetColumnError( )
methods to get and set the error
description for a particular column.