To associate visual controls on a form with a data module, you must first add the data module to the form's uses clause. You can do this in several ways:
Because the data source is not yet defined, Delphi adds a new data source component, DataSource1, to the form and sets the edit box's DataSource property to DataSource1. The data source automatically sets its DataSet property to the dataset component, ClientDataSet1, in the data module.
You can define the data source before you drag a field to the form by adding a TDataSource component to the data module. Set the data source's DataSet property to ClientDataSet1. After you drag a field to the form, the edit box appears with its TDataSource property already set to DataSource1. This method keeps your data access model cleaner.
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
|
What do you think about this topic? Send feedback!
|