ComponentOne DataObjects for .NET
Simple Tables
DataObjects for .NET (Enterprise Edition) > Schema Objects > Simple Tables

Simple tables are the basic, elementary data objects in a schema. We distinguish between simple and composite tables, although both are Table objects and for the most part can be used interchangeably. Composite tables combine multiple simple tables in a single Table object. A composite table row contains fields from different tables, see Composite Tables for details.

The Table class is abstract, actual Table objects are either simple tables (DbTable) or composite (CompositeTable).

A simple table usually corresponds to a database table (or view), that is, if it has a non-empty DbTableName. In this case, we say that the simple table is based on the database table. This is enough to satisfy most application needs, because in addition to this, the composite table mechanism provides the ability to combine simple tables to form complex objects. However, there is also an option to use SQL-based and unbound tables that are not based on a single database table. A SQL-based table is based on a SQL statement or stored procedure, either by setting the SelectCommandText property or by setting the SQL statement in code. An unbound table is filled with data entirely by code. See Bound, SQL-Based and Unbound Tables for details.

At run time, each simple table has data in a collection of rows. However, this collection of rows is not usually exposed to the user directly, but through another schema object, a TableView. One simple table can participate in many table views, presenting the table's data to the user in different structure arrangements. This is one of the most powerful features of DataObjects for .NET: structured data consistently maintained without manual coding. This also means that a simple table does not necessarily include all rows of the underlying database table. The process of filling simple tables with rows (fetching rows) is initiated by TableView objects, each table view making its contribution. See the details in Structured Data Storage: Tables and Table Views.

Each table, both simple and composite, has the Fields collection. Table fields define the structure of a table row. Field properties affect the way the field data is stored and manipulated, and how modifications are sent back to the database. A table's Fields collection is not necessarily in one-to-one correspondence with the database fields, the fields of the database table on which the table is based. The fields can have different order, some fields can be deleted, and some fields can be added that are not based on a database field (unbound fields). See Table Fields for more details.

See Also