RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomDataSetAdapter.PrepareDataSet Method

Sets up the associated dataset for use by this adapter.

Pascal
procedure PrepareDataSet; virtual;
C++
virtual __fastcall PrepareDataSet();

TCustomDataSetAdapter calls PrepareDataSet before it reads the DataSet property the first time after the dataset enters a new mode. This method performs any necessary tasks for initializing the dataset for use by the adapter in the current mode. 

PrepareDataSet generates an OnPrepareDataSet event to allow you to perform your own initializations. It then cancels any pending edits and informs any fields that are used in the current mode so that they can perform their own initializations.

Note: Do not confuse the PrepareDataSet property with the Prepare method of many dataset components. PrepareDataSet allows the adapter to performed any tasks it requires to set up the dataset for its own use in the current mode. The Prepare method of a dataset component instructs the underlying database engine to initialize itself to represent a database query.
 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!