1. Trang chủ
  2. » Công Nghệ Thông Tin

Tài liệu The DataTable Class pdf

3 293 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 3
Dung lượng 22,64 KB

Nội dung

The DataTable Class You use an object of the DataTable class to represent a table. You can also store multiple DataTable objects in a DataSet. Table 11.1 shows some of the DataTable properties. Table 11.1: DataTable PROPERTIES PROPERTY TYPE DESCRIPTION CaseSensitive bool Gets or sets a bool value that indicates whether string comparisons within DataTable objects are case-sensitive. ChildRelations DataRelationCollection Gets the collection of relations (DataRelationCollection) that allows navigation from a parent table to a child table. A DataRelationCollection consists of DataRelation objects. Columns DataColumnCollection Gets the collection of columns (DataColumnCollection) that contains DataColumn objects that represent the columns in the DataTable object. Constraints ConstraintCollection Gets the collection of constraints (ConstraintCollection) that contains Constraint objects that represent primary key (UniqueConstraint) or foreign key constraints (ForeignKeyConstraint) in the DataTable object. DataSet DataSet Gets the DataSet to which the DataTable belongs. HasErrors bool Returns a bool value that indicates whether any of the rows in the DataTable have errors. PrimaryKey DataColumn[] Gets or sets an array of DataColumn objects that are the primary keys for the DataTable. Rows DataRowCollection Gets the collection of rows (DataRowCollection) that contains the DataRow objects stored in the DataTable. TableName string Gets or sets the name of the DataTable object. Table 11.2 shows some of the DataTable methods. Table 11.2: DataTable METHODS METHOD RETURN TYPE DESCRIPTION AcceptChanges() void Commits all the changes made to the DataTable object since it was loaded or since the last time the AcceptChanges() method was called. Clear() void Removes all rows from the DataTable object. Clone() DataTable Clones the structure of the DataTable object and returns that clone. Compute() object Computes the given expression on the current rows that pass the filter criteria. GetChanges() DataTable Overloaded. Returns a copy of the DataTable object since it was last loaded or since the last time the AcceptChanges() method was called. GetErrors() DataRow[] Overloaded. Gets a copy of all the DataRow objects that have errors. LoadDataRow() DataRow Finds and updates a specified DataRow object. If no matching object is found, a new row is created using the specified values. NewRow() DataRow Creates a new DataRow object in the DataTable. RejectChanges() void Undoes all the changes made to the DataTable object since it was created or since the last time the AcceptChanges() method was called. Select() DataRow[] Overloaded. Returns the array of DataRow objects stored in the DataTable that match the specified filter string. You can also pass a string containing details on how to sort the DataRow objects. Table 11.3 shows some of the DataTable events. Table 11.3: DataTable EVENTS EVENT EVENT HANDLER DESCRIPTION ColumnChanging DataColumnChangeEventHandler Fires before a changed DataColumn value is committed in a DataRow. ColumnChanged DataColumnChangeEventHandler Fires after a changed DataColumn value is committed in a DataRow. RowChanging DataRowChangeEventHandler Fires before a changed DataRow is committed in a DataTable. Table 11.3: DataTable EVENTS EVENT EVENT HANDLER DESCRIPTION RowChanged DataRowChangeEventHandler Fires after a changed DataRow is committed in a DataTable. RowDeleting DataRowChangeEventHandler Fires before a DataRow is deleted from a DataTable. RowDeleted DataRowChangeEventHandler Fires after a DataRow is deleted from a DataTable. . The DataTable Class You use an object of the DataTable class to represent a table. You can also store multiple DataTable objects in. rows from the DataTable object. Clone() DataTable Clones the structure of the DataTable object and returns that clone. Compute() object Computes the given

Ngày đăng: 26/01/2014, 07:20

TỪ KHÓA LIÊN QUAN

w