Add Demystifying the Client Dataset


The TClient Dataset component available in Delphi encapsulates a lot more features than one would expect from a dataset component. TClient DataSet is a specialized component that holds data in-memory and can be used effectively in different application architectures. It does not require a database connection to work and for that reason it is suited to file-based application architecture.

The client dataset can be used in single-tiered or two-tiered application and multi-tiered applications as effectively to cache updates and resolve them in one transaction. The client dataset offers robustness, speed and flexibility, and has features to make the best use of whichever architecture it is a part. Since it is self-contained and does not require persistent server connection applications created, using it is not dependent on data access mechanisms like BDE or ADO. For the same reason applications using the client dataset are easier to port to other platforms without requiring a complete rework.

The list of features and methodologies offered by the TClientDataset component is exhaustive so there is always a probability that you might not have discovered all of its functions. In this series of articles I will attempt to demonstrate how the client dataset can be included and taken advantage of in all three architectures I mentioned above -- file based, single-tiered or two-tiered and n-tiered architectures.

Most datasets you are likely to work with commit transactions with the data source the moment you make a change. As you insert records, delete or edit them, the information is sent to the database server which modifies/inserts/deletes records to reflect the changes you made. If you are connecting to a remote database server, continuous transactions can increase your network traffic to such an extent that it may actually degrade the performance.

To avoid this you can use the Client Dataset to fetch records, store and edit them locally and commit them to the database in a single transaction. This approach helps reduce network traffic and enhances the performance of your application. Before proceeding further let us take a closer look at the TClientDataSet component. 

The Client Dataset component was introduced in Delphi 3 as a specialized dataset to work with MIDAS (now called DataSnap) applications. However, its features are not limited to MIDAS applications; it can be substituted for most datasets when  greater flexibility and control over the database transaction is needed. The last two versions of Delphi I have worked on, Delphi 7 (cs edition) and Delphi 2006 (BDS 2006), contain the Client Dataset component in the tools pallet, but I have read that some versions don't. Assuming that your version of Delphi includes the client dataset component, let us find out more about this component.
Related Discussions
  • DEFAULT EMAIL CLIENT (2001-01-03 23:54:27)
    HKEY_CLASSES_ROOT\mailto\shell\open\command\ /Filip
  • QREPORT & TQUERY QUESTION (D5) (2001-01-09 04:12:35)
    though in your question you said that the dataset property of the quickreport is configured but i bet that you have not because that is the only...
  • PRINTING........??? (2001-01-09 08:44:49)
    Do you want to achieve information from the printer device as it is printing the specific job? Do you want to snap every print requests on the...
  • HOW CAN I ACCESS BTRIEVE DATA FILES (2001-01-24 06:38:59)
    Try downloading the Btrieve programmer's guide : ftp://ftp.pervasive.com/documentation/btrieve/v615/B615PROG.PDF Good luck ...
  • HOW TO DO PING? (2001-01-10 12:28:57)
    You can use the ECHO protocol in which PING is based. Take a look to the TNMEcho component in FastNet page of Delphi component Palette.
  • DB COMBO PBS (2001-05-04 03:50:23)
    Thanks, but all of the properties (ListSource, DataSet and the corresponding LookUp fields) have been correctly set (I think), in fact some of the...
  • HOW TO SEND A BITMAP (TBITMAP) WITH THE TSERVERSOCKET/TCLIENTSOCKET? (2001-01-17 07:12:25)
    Hi thx for your help, but it won't work with me too, i can't find out what i am doing wrong, i put a source code here, maybe someone can tell me...
  • HOW TO SAVE A BLOBFIELD IN DATABASE FROM THE OLE OBJECT (2002-02-20 22:19:59)
    To Mystika : thank you very much.
  • TCP/IP CLIENT - SERVERS COMPONENTS (2001-01-19 15:38:58)
    Hey! It is true that these components have their bugs (I haven't discovered any component that doesn't have any bug in any condition) :) but I...
  • DELPHI COMPONENT (2001-01-21 15:55:08)
    Hey! All i can suggest you is a piece of code (really confusing one) but I think that will do the job. Well... here it is... a long one but...
Latest News
Submit News Form Past News
Latest Forum Entries