Features and Techniques > Modifying Field Values, Retrieving and Saving Them in the Data Source |
In many cases it is necessary to modify values retrieved from the data source and immediately before saving changed values. For example,
It is usually convenient to represent retrieved Null values of string fields as empty strings and save empty strings in the database as Nulls.
You might want to decode or format values retrieved from the database, and vice versa, encode or unformat them before saving changes to the database.
You might want to convert a string value entered by the user to uppercase.
True DataControl provides convenient and intuitive ways to specify such transformation. They are performed when data is retrieved from the data source and when it is written back, transparently to all other TData features. This means that once a row has been fetched from the data source, its fields undergo the specified transformation and from then on the transformed values are used by TData. In the opposite direction, immediately before the changed data is written to the data source, it undergoes the specified transformation.