Ricardo Acras
Ricardo Acras

Reputation: 36244

Copy TClientDataSet contents with field configurations

I would like to copy a whole TClientDataSet instance into another so I can recover any changes made in the original one. I've tried to saveToStream, to copy the data property but in all cases I loose the fields configurations (displayLabel, size, etc.)

Is there a way to do what I'm trying?

Upvotes: 0

Views: 3496

Answers (3)

Ben Ziegler
Ben Ziegler

Reputation:

This should work:

DestClientDataSet.Data := SrcClientDataSet.Data;

Upvotes: 2

Serguzest
Serguzest

Reputation: 1307

Did you try TClientdataset.Clonecursor ?

Upvotes: 0

MarkusQ
MarkusQ

Reputation: 21950

Delphi will only stream published properties. You may need to tweak things a bit to get everything out & back correctly. See http://www.delphipages.com/news/detaildocs.cfm?ID=145 for an example of the hooks.

-- MarkusQ

Upvotes: 2

Related Questions