JavaScript Editor JavaScript Editor     JavaScript Debugger

Previous Section Next Section

Main Page

Using the DataTable Class

The DataTable class represents a table of data. Here is the inheritance hierarchy of this class:

Object
   MarshalByValueComponent
      DataTable

You can find the more notable public properties of DataTable objects in Table 22.28, their more notable methods in Table 22.29, and their more notable events in Table 22.30.

Table 22.28: Noteworthy public properties of DataTable objects.

Property

Means

CaseSensitive

Indicates if string comparisons are case-sensitive.

ChildRelations

Gets the child relations for this table.

Columns

Gets columns in this table.

Constraints

Gets constraints for this table.

DataSet

Gets the dataset that this table belongs to.

DefaultView

Gets a customized view of the table.

HasErrors

Indicates if there are errors in any of the rows in the table.

Locale

Gets/sets the locale data used to compare strings.

MinimumCapacity

Gets/sets the table's starting size.

Namespace

Gets/sets the XML namespace for data in the table.

ParentRelations

Gets the parent relations for this table.

PrimaryKey

Gets/sets the columns that act as primary keys.

Rows

Gets the rows in this table.

TableName

Gets/sets the name of the table.

Table 22.29: Noteworthy public methods of DataTable objects.

Method

Means

AcceptChanges

Accepts (commits) the changes made to the table.

BeginInit

Begins the initialization of a table.

BeginLoadData

Turns off table updating while loading data.

Clear

Clears the data in the table.

Compute

Computes an expression with rows that pass the filter criteria.

Copy

Copies the table.

EndInit

Ends the initialization of a data table.

EndLoadData

Ends the data loading operation.

GetChanges

Gets a copy of the table with all changes made to it since the AcceptChanges method was last called.

GetErrors

Gets the rows that contain errors.

ImportRow

Copies a row into a table.

LoadDataRow

Finds and updates a row; if the row can't be found, a new row is created.

NewRow

Creates a new row, using the table's schema.

RejectChanges

Rolls back the changes made to the table since it was created or since the AcceptChanges method was called.

Select

Gets an array of rows.

Table 22.30: Noteworthy public events of DataTable objects.

Event

Means

ColumnChanged

Occurs after a value in a column was changed.

ColumnChanging

Occurs when a column's value is being changed.

RowChanged

Occurs after a row has been changed.

RowChanging

Occurs when a row is being changed.

RowDeleted

Occurs after a row was deleted.

RowDeleting

Occurs when a row is about to be deleted.

Previous Section Next Section




JavaScript Editor Free JavaScript Editor     JavaScript Editor