Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (20.18 KB, 2 trang )
The DataRow Class
You use an object of the DataRow class to represent a row. You can also store multiple
DataRow objects in a DataTable. Table 11.4
shows some of the DataRow properties.
Table 11.4: DataRow PROPERTIES
PROPERTY TYPE DESCRIPTION
HasErrors bool Returns a bool value that indicates whether any of the
DataColumn objects in the DataRow have errors.
ItemArray object[] Gets or sets all the DataColumn objects in the DataRow.
RowState DataRowState Gets the current state of the DataRow. The state can be
Added, Deleted, Detached~FT, Modified, or Unchanged.
The state depends in the operation performed on the
DataRow and whether the AcceptChanges() method has
been called to commit the changes.
Table DataTable Gets the DataTable object to which the DataRow belongs.
The row has been created but isn't part of a DataRowCollection object; a DataRow is in
this state immediately after it has been created and before it is added to a collection, or i
f
it has been removed from a collection.
Table 11.5 shows some of the DataRow methods.
Table 11.5: DataRow METHODS
METHOD RETURN
TYPE
DESCRIPTION
AcceptChanges() void Commits all the changes made to the DataRow
object since it was loaded or since the last time the
AcceptChanges() method was called.
BeginEdit() void Starts an edit for the DataRow object.
CancelEdit() void Cancels an edit for the DataRow object and