I try to directly assign Data to ClientDataSet like it described in documentation here: https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Assigning_Data_Directly. I need to refresh source dataset and keep up working target dataset in memory at the same time.
I do it using temp provider object because this method gives calculating fields in the target dataset:
TempProvider := TDataSetProvider.Create(Form1);
TempProvider.DataSet := SourceDataSet;
ClientDataSet1.Data := TempProvider.Data;
TempProvider.Free;
I have the record set about 30 000 records. Setting is going successfully but if I change Data property in the source dataset I have an exception "Out of memory".
By the way, if I use method CloneCursor for the same effect and update Data in source dataset I have an exception "Access violation" when I address to field values in a target dataset.
Unfortunately, I can not explore this behaviour with debugging because errors occur from external dll functions of Datasnap library.
What's the matter? How to copy Data to ClientDataSet by creating independent instance?