Sunday, August 26, 2007

ADO.net > DataTable > Methods and Properties

IMPORTANT PROPERTIES OF DATATABLE CLASS

ChildRelations >> Get the collection of child relations
Columns/Rows >> Get the collection of child columns/rows
Constraints Get the collection of constraints
DataSet >> Name of the DataSet to which the DataTable belongs to
Rows
PrimaryKey >> Get the PK of the table
TableName >> Get/Set the table name

===============================================================

IMPORTANT METHODS OF THE DATATABLE CLASS

AcceptChanges / RejectChanges >> Commit / Rollback for changes made to data in the DataTable
HasChanges / GetChanges >> GetChanges returns a dataset containing changed rows
Clone >> Copies the structure (schemas,relations) only, but NOT DATA
Copy >> Makes a deep copy, it is CLONING WITH DATA
ImportRow >> Deep copy of DataRow
ReadXml >> Populate the DataTable by reading schema and data from XML doc
Clear / Reset >> Remove all rows / Empties tables, relations and constraints
Compute >> Compute the given expression on rows, returns object
CreateDataReader >> Returns a DataTableReader object

No comments: