Refreshing Data Display

From RAD Studio
Jump to: navigation, search

Go Up to Using Common Data Control Features


The Refresh method for a dataset flushes local buffers and re-fetches data for an open dataset. You can use this method to update the display in data-aware controls if you think that the underlying data has changed because other applications have simultaneous access to the data used in your application. If you are using cached updates, before you refresh the dataset you must apply any updates the dataset has currently cached.

Refreshing can sometimes lead to unexpected results. For example, if a user is viewing a record deleted by another application, then the record disappears the moment your application calls Refresh. Data can also appear to change if another user changes a record after you originally fetched the data and before you call Refresh.

Note: If you are using the LiveBindings Designer, you can refresh the data display by using the Refresh Designer command on the context menu of the LiveBindings Designer. This command is especially useful if one form has a TClientDataSet that is linked to a TBindSourceDB on another form.

See Also