True DataControl 8.0 Reference > True DataControl Control > TData Control Properties > ConvertEmptyToNull Property |
ConvertEmptyToNull Property
Specifies if empty string values should be converted to Null on save.
TData.ConvertEmptyToNull = boolean
Read/Write at run time and design time. Property applies to TData control and TDataLite control.
If set to True (default), this property makes TData save empty string values in the database as Null values. Otherwise, empty strings are written literally, as empty strings. Most databases will convert them to Null anyway, so it rarely makes sense to change the default ConvertEmptyToNull=True to False. Non-string fields are not affected by this property, there values are never automatically converted to Null. If you need to convert some particular values (for example, 0) to Null for such fields, use the DataWrite event. For more information, see Modifying Field Values Retrieving and Saving Them in the Data Source.
Note: At design time, this property is not available in the property pages and must be set in the Visual Basic Properties window.
See Also