Calculated fields contain expressions that are evaluated at run-time. These can be added to a data source using DataSource.CalculatedFields.Add method.
The code to add a calculated field, say 'Calc1' that calculates 'CategoryID * 2' , of the Integer type, is as follows:
Note that if there are more than one Calculated field, they must have unique names.