Query property editor
Use the Query property editor to set the properties of a query when using the QueryDataSet component.
To display this property editor, choose the query property from the Component Inspector when a QueryDataSet component is highlighted in the Component Tree. The property values referenced in this dialog are stored in the QueryDescriptor object.
Database
This drop-down list displays the names of all instantiated Database objects to
which this QueryDataSet can be bound. This property must be set, for the query to run successfully.
Selecting an instantiated Database object enables the Browse Tables button.
Browse Tables
Click this button to display the Available Tables and Columns dialog. The Available Tables and Columns dialog displays a list of tables in the specified Database, and the columns in the selected table. The Paste Table and Paste Column buttons allow you to quickly create your query statement by pasting the name of the selected table (by clicking the Paste Table button) or selected column (by clicking the Paste Column) button into your query statement at the cursor's current (insertion) point.
This button is dimmed and unavailable while the Database field displays the value "<none>". Select a database object in the Database field to enable this button.
SQL Statement
Enter the query statement to run against the Database specified in the Database drop-down list. Use the Browse Tables button to quickly create your SQL statement by pasting in selected table and column names. This is a required property and must be set to a valid SQL statement. If the SQL statement does not return a result set, an exception is generated.
Execute query immediately when opened
This option determines whether the query executes automatically when the QueryDataSet is opened. This option defaults to checked, which allows live data to display in the UI Designer when the QueryDataSet is bound to a data-aware control.
Asychronous execution (runs in a separate thread)
This option determines whether a new thread is created when executing the query and fetching the results (checked) or whether the query is run in the current thread (not checked, the default). Selecting this option can yield better performance. However, running the query in a separate thread can introduce the possibility of dead-lock. This option defaults to non-checked which means that the query runs in the current thread.
Test query
Click this button to test the SQL statement and other properties on this dialog against the specified Database. The results are displayed in the gray area directly beneath the Test Query button.