True DataControl 8.0 Reference > True DataControl Control > TData Control Properties > DataMode Property |
DataMode Property
Specifies the type of data storage on which the control operates.
TData.DataMode = value
Read/Write at design time. Read-only at run time. Property applies to TData control and TDataLite control.
Design Time |
Run Time |
0 - DataSource (default) |
tdbModeDataSource |
1 - MemoryArray |
tdbModeMemoryArray |
2 - UserEvents |
tdbModeUserEvents |
This property defines the source and storage of data on which a TData control operates.
When set to 0 - DataSource (the default), the TData control uses an ADO recordset as its underlying data. The recordset can be created by the TData control automatically if you set all relevant data source properties, or else you can set the SourceRecordset property in code.
When set to 1 - Memory Array, the TData control creates an XArrayDB object containing one row of empty data, with one column for each field. Alternatively, you can set the Array property to a pre-initialized XArrayDB object in code.
When set to 2 - User Events, you must write a handler for the UserReadData event. Depending upon the requirements of your application, you may also need to write handlers for the UserAddData, UserWriteData, UserDeleteRow, and UserFindData events. This mode is unavailable in True DataControl Lite.
For more information, see Data Access Modes.
See Also