ComponentOne DataObjects for .NET
DataObjects for .NET Expressions
DataObjects for .NET (Enterprise Edition) > Features and Techniques > DataObjects for .NET Expressions

DataObjects for .NET uses expressions to specify constraints and field calculations. DataObjects for .NET expression language is based on the ADO.NET expression language; for more information see the reference entry for the System.Data.DataColumn.Expression property in .NET Framework Reference documentation. For your convenience, the expression language reference is partly reproduced below.

Expression variables are fields of tables and table views, see Schema Objects. In an expression belonging to a table or table view, you can use fields from the same table (or table view) and from its parents and children with regard to relations, if they are included in the same data set.

In addition to operators and functions defined in the ADO.NET expression language, DataObjects for .NET expressions support the following functions:

Function Description
Current Syntax: Current(field). Example: Current(OrderDate). Returns the value of the field in a row as it was before editing of the row started (BeginEdit was called). It is the same value as returned by C1DataRow["field_name", DataRowVersionEnum.Current]. If the row is not in edit mode, this function returns the same value as the field without a function. For a row in edit mode, the field without a function returns C1DataRow["field_name", DataRowVersionEnum.Proposed].
Original Syntax: Original(field). Example: Original(OrderDate). Returns the value of the field in a row as it was when the row was fetched from the database. It is the same value as returned by C1DataRow["field_name", DataRowVersionEnum.Original].
BeforeChange Syntax: BeforeChange(field). Example: BeforeChange(OrderDate). When the value of a field is being changed (including in events BeforeFieldChange and AfterFieldChange), the field variable returns the new value even if the new value has not yet been assigned to the field (for example, in the BeforeFieldChange event). If you need the field value as it was before the change, use this function. While the field value is being changed (including in events BeforeFieldChange and AfterFieldChange), this function returns the value before change. If the field value is not being changed when the function is evaluated, it returns the same value as the field variable without a function.
See Also