RAD Studio
ContentsIndex
PreviousUpNext
Using TSimpleDataSet

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
  1. From the dbExpress category of the Tool Palette, drag a TSimpleDataSet component to the form.
  2. Set its Name property to a unique value appropriate to your application.
  3. From the dbExpress section of the Tool Palette, drag a TSQLConnection component on the form.
  4. Select TSimpleDataSet component. Set the Connection property to TSQLConnection component.
  5. 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.
  6. If the stored procedure returns a cursor to be used with visual data controls, add a data source component to the form.
  7. Set the DataSet property of the data source component to the TSimpleDataSet object.
  8. To activate the dataset, use the Active property or call the Open method.
  9. If you executed a stored procedure, use the Params property to retrieve any output parameters.
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!