TDatasetProvider provides the mechanism to get data into a TClientDataset.
TDatasetProvider is like a pipe connecting TClientDataset with TSQLDataset.
Typically if you want to show records from your database table on a TDBGrid in your application then you will need the following components.
TSQLConnection to provide the necessary connection details to the database. One TSQLConnection can service several TSQLDatasets.
A TSQLDataset component which will specify the TSQLConnection component in the SQLConnection property. The CommandText property of the TSQLDataset will have a suitable SQL statement such as
Code:
SELECT * FROM customer WHERE balance>100 ORDER BY balance
A TDatasetProvider component which will specify the TSQLDataset in its Dataset property.
A TClientDataset component which will specify the TDatasetProvider in its ProviderName property
A TDataSource component which will specify the TClientDataset component in its Dataset property.
A TDBGrid component which will specify the TDataSource in its DataSource property.
By setting the appropriate Active properties to true in TSQLConnection, TSQLDataset and TClientDataset you should find that the data will appear in the grid.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.