You probably already read my post Copying data from DBXReader to ClientDataSet, now is time to learn how copy data from ClientDataSet to DBXReader using Delphi or C++Builder.
There are many situations where you will need to copy data between ClientDataSet and DBXReader, specially if you are looking to cache data on DataSnap Servers, I’m preparing a new blog post about that and will publish soon.
The DBXDBReaders unit is part of DBX Framework and contain the TDBXDataSetReader class which is a TDBXReader implementation of TDataSet, in other words using this class you will get a DBXReader representation of any DataSet.
You just need to create a instance of TDBXDataSetReader passing the ClientDataSet and the InstanceOwner (true/false). If InstanceOwner is true, the TDataSet instance is freed when the TDBXDataSetReader instance is freed.
TDBXDataSetReader.Create(ClientDataSet, False (* InstanceOwner *) )
TDBXDataSetReader->Create(ClientDataSet, False )
TDBXDataSetReader class is compatible with DataSnap 2010 and XE.