TClientDataSet Temporary Table

1

Good evening.

My question is this: I have a temporary table created in TClientDataSet .

However, I need to write the temporary table data to an XML file and then re-read the TClientDataSet , that is, delete the records and re-insert all of them.

However, in my ListView , duplicate records or empty records are appearing, and I already checked the XML, and everything is ok.

Any tips on temporary tables using TClientDataSet ?

    
asked by anonymous 10.11.2015 / 01:45

1 answer

1

So, after a lot of research, I learned that ApplyUpdates(0); does not work on temporary tables, that is, all I did was to define the fields I want in TClientDataSet after this, right click and CreateDataSet , then complete, make your changes this way:

Edit:

cds.Edit;
valor := cdscampo.value;
cds.Post;

Add:

cds.Append;
cdscampo.value := valor;
cds.Post;

Delete:

cds.Delete;

To simplify, I used the IXMLDocument declared and created in the recording function itself.

    
12.11.2015 / 01:15