Using TSimpleDataSet
Go Up to How To Perform Database Procedures
TSimpleDataSet is a special type of client dataset designed for simple two-tiered applications. Like a unidirectional dataset, it can use an SQL connection component to connect to a database server and specify an SQL statement to execute on that server. Like other client datasets, it buffers data in memory to allow full navigation and editing support.
To use TSQLStoredProc
- From the dbExpress category of the Tool Palette, drag a TSimpleDataSet component to the form.
- Set its Name property to a unique value appropriate to your application.
- From the dbExpress section of the Tool Palette, drag a TSQLConnection component on the form.
- Select TSimpleDataSet component. Set the Connection property to TSQLConnection component.
- To fetch data from the server, do any of the following:
- Set CommandType to ctQuery and set CommandText to an SQL statement you want to execute on the server.
- Set CommandType to ctStoredProc and set CommandText to the name of the stored procedure you want to execute.
- Set CommandType to ctTable and set CommandText to the name of the database tables whose records you want to use.
- If the stored procedure returns a cursor to be used with visual data controls, add a data source component to the form.
- Set the DataSet property of the data source component to the TSimpleDataSet object.
- To activate the dataset, use the Active property or call the Open method.
- If you executed a stored procedure, use the Params property to retrieve any output parameters.