A Guide to Using the TClientDataSet in Delphi Applications

Two men looking at computer
Jupiterimages/Stockbyte/Getty Images

Looking for a single-file, single-user database for your next Delphi application? Need to store some application specific data but don't want to use the Registry / INI / or something else?

Delphi offers a native solution: The TClientDataSet component -- located on the "Data Access" tab of the component palette -- represents an in-memory database-independent dataset. Whether you use client datasets for file-based data, caching updates, data from an external provider (such as working with an XML document or in a multi-tiered application), or a combination of these approaches in a "briefcase model" application, take advantage of the broad range of features that client datasets support.

Delphi Datasets

A ClientDataSet in Every Database Application
Learn the basic behavior of the ClientDataSet, and encounter an argument for the extensive use of ClientDataSets in most database applications.

Defining a ClientDataSet's Structure Using FieldDefs
When creating a ClientDataSet's memory store on-the-fly, you must explicitly define the structure of your table. This article shows you how to do it at both runtime and design-time using FieldDefs.

Defining a ClientDataSet's Structure Using TFields
This article demonstrates how to define a ClientDataSet's structure at both design-time and runtime using TFields. Methods to create virtual and nested dataset fields are also demonstrated.

Understanding ClientDataSet Indexes
A ClientDataSet does not obtain its indexes from the data it loads. Indexes, if you want them, must be explicitly defined. This article shows you how to do this at design-time or runtime.

Navigating and Editing a ClientDataSet
You navigate and edit a ClientDataSet in a manner similar to how you navigate and edit almost any other dataset. This article provides an introductory look at basic ClientDataSet navigation and editing.

Searching a ClientDataSet
ClientDataSets provide several different mechanisms for searching for data in its columns.

These techniques are covered in this continuation of the discussion of basic ClientDataSet manipulation.

Filtering ClientDataSets
When applied to a dataset, a filter limits the records that are accessible. This article explores the ins-and-outs of filtering ClientDataSets.

ClientDataSet Aggregates and GroupState
This article describes how to use aggregates to calculate simple statistics, as well as how to use group state to improve your user interfaces.

Nesting DataSets in ClientDataSets
A nested dataset is a dataset within a dataset. By nesting one dataset inside another, you can reduce your overall storage needs, increase the efficiency of network communications and simplify data operations.

Cloning ClientDatSet Cursors
When you clone a ClientDataSet's cursor, you create not only an additional pointer to a shared memory store but also an independent view of the data. This article shows you how to use this important capability

Deploying Applications that use ClientDataSets
If you use one or more ClientDataSets you may need to deploy one or more libraries, in addition to your application's executable. This article describes when and how to deploy them.

Creative Solutions Using ClientDataSets
ClientDataSets can be used for much more than displaying rows and columns from a database.

See how they solve application problems including selecting options to process, displaying progress messages and creating audit trails for data changes.