ComponentOne DataObjects for .NET
DB Fields and Calculated Fields
DataObjects for .NET Express Edition > C1ExpressTable: Working with Simple and Composite Tables > Defining Fields > DB Fields and Calculated Fields

A DB field represents a database table field as determined by its DbFieldName property.

A calculated field is not based on a database field. Its value is determined by one or more calculations (FieldCalculationInfo objects) or assigned in code. Each calculation (FieldCalculationInfo) contains an Expression, which is the expression used to obtain field values (see DataObjects for .NET Expressions for a description of DataObjects for .NET expression language), and two additional properties: Condition and FireEvent. Condition is an optional Boolean expression determining calculation's applicability. If Condition evaluates to False, the calculation expression is skipped, not evaluated. If a field has multiple calculations, DataObjects for .NET Express applies the first with Condition expression evaluating to True. If none is applicable, the field value is left unchanged. FireEvent is a Boolean property set to False by default. If it is set to True, setting the value from calculation expression triggers the same sequence of events (BeforeFieldChange, AfterFieldChange, and AfterChanges) as if the value has been modified by the end user. Field calculations are useful for DB fields as well as for calculated fields. In this case, they are usually qualified by Condition expressions. Depending on the conditions, a field's value can be derived from a value stored in the database, or it can be calculated. For instance, if field A is non-empty, field B always returns the same value as A, but if A is empty, B can be set independently of A.