The DataRowView Class

Chia sẻ: Tuan Nghia | Ngày: | Loại File: PDF | Số trang:2

0
70
lượt xem
6
download

The DataRowView Class

Mô tả tài liệu
  Download Vui lòng tải xuống để xem tài liệu đầy đủ

The DataRowView Class Rows in a DataView object are stored as objects of the DataRowView class.

Chủ đề:
Lưu

Nội dung Text: The DataRowView Class

  1. The DataRowView Class Rows in a DataView object are stored as objects of the DataRowView class. A DataRowView object provides access to the underlying DataRow object in a DataTable. When you examine and edit the contents of a DataRowView, you are actually working with the underlying DataRow. Keep this in mind when working with DataRowView objects. Table 13.4 shows some of the DataRowView properties, and Table 13.5 shows some of the DataRowView methods. Table 13.4: DataRowView PROPERTIES PROPERTY TYPE DESCRIPTION DataView DataView Gets the DataView that the DataRowView belongs to. IsEdit bool Gets a bool that indicates whether the DataRowView (and therefore the underlying DataRow) is in edit mode. IsNew bool Gets a bool that indicates whether the DataRowView has just been added. Row DataRow Gets the underlying DataRow that is being viewed from the DataTable. RowVersion DataRowVersion Gets the DataRowVersion of the underlying DataRow. Members of the System.Data.DataRowVersion enumeration are • Current, which indicates the DataRow contains the current values. • Default, which indicates the DataRow contains the default values. • Original, which indicates the DataRow contains the original values. • Proposed, which indicates the DataRow contains proposed values. Table 13.5: DataRowView METHODS METHOD RETURN DESCRIPTION TYPE BeginEdit() void Begins editing of the DataRowView in your DataView, and therefore begins the editing of the underlying DataRow in your DataTable. You then edit this DataRow through the DataRowView.
  2. Table 13.5: DataRowView METHODS METHOD RETURN DESCRIPTION TYPE CancelEdit() void Cancels editing of the DataRowView in your DataView, and therefore cancels editing of the underlying DataRow. CreateChildView() DataView Overloaded. Returns a DataView for a child DataTable, if present. Delete() void Deletes the DataRowView in your DataView. The deletion of the underlying DataRow isn't committed in the DataTable until you call the AcceptChanges() method of your DataTable. You can undo the deletion by calling the RejectChanges() method of your DataTable, which also undoes any uncommitted additions or modifications. EndEdit() void Ends the editing of a DataRowView.
Đồng bộ tài khoản