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

A Schema is the basis and starting point of DataObjects for .NET development. It contains data structure information, defining basic entities, such as tables and relations, with their properties. Normally, a schema is initially created by importing a database structure using the Import Wizard in the Schema Designer, and then customized in the Schema Designer to suit your business logic needs. A schema can also be imported from an ADO.NET schema. For additional information, see Converting Schema from Other Sources.

A schema is stored in a C1SchemaDef component, in the form of an XML string in the .resx resource file. To create or edit a schema, open the context menu of a C1SchemaDef component and select Schema Designer from the menu.

A DataObjects for .NET data library always contains a single schema, that is, a single C1SchemaDef component. An application that uses DataObjects for .NET directly, without a data library (direct client) is allowed to have multiple schemas, each stored in its own C1SchemaDef component.

In most cases, a schema is created at design time in the Schema Designer, and used at run time without modification. However, all schema objects are programmatically accessible at run time through the schema object model, with the Schema class being the root of that object model. Using this object model, it is also possible to modify the schema or even define it from scratch at run time, using the CreateSchema event. This, however, is rarely needed, so you will not need to use schema objects programmatically unless in special cases. Most of the time, you will only deal with schema objects at design time, in the Schema Designer.

Schema objects, classes comprising the Schema object model, are structure-only, they do not contain actual data. They are created when a C1SchemaDef component is initialized and immediately become accessible through its Schema property, before any data is fetched. Moreover, they do not represent the actual data, they only represent the structure. The actual data is fetched and managed by another component, C1DataSet. There can be multiple C1DataSet components bound to a single schema.


A C1DataSet component holds a collection of C1DataTable objects, each one representing a set of rows existing in this data set for a particular schema object. In fact, a C1DataSet has two collections of C1DataTable objects: Tables for data contents of Table schema objects, and TableViews for data contents of TableView schema objects. The SchemaTable property returns the schema object (either Table or TableView) defining the structure of this C1DataTable.

See Also