1

This was continuation to my previous question.

I dont want PARAMS CHANGE_LOG data in my XML file while saving the data in ClientDataSet using ClientDataSet1.SaveToFile() method.

My code looks like this:

ClientDataSet1.Insert;
ClientDataSet1.FieldByName('Name').AsString:= 'AAA';
ClientDataSet1.Append;
ClientDataSet1.SaveToFile('c:\Test.xml',dfxml);

How can i achieve this.

Community
  • 1
  • 1
Bharat
  • 6,828
  • 5
  • 35
  • 56

2 Answers2

5

Set the LogChanges property of your CLientDAtaSet to False, and it will not bulid the ChangeLog for you...

Bob Swart
  • 1,278
  • 7
  • 6
  • Thanks Bob. Can you suggest me which is more effective MergeChangeLog or LogChanges=False – Bharat Oct 22 '10 at 12:48
  • @Bharat - If you won't make use of the change log, setting 'LogChanges' to false is more effective. When LogChanges is true, data editing becomes slower over time (until changes are merged). – Sertac Akyuz Oct 22 '10 at 19:06
  • Setting LogChanges to False is more efficient, since it never needs to save the deltas, and will just apply the changes with every post or insert/delete. – Bob Swart Nov 09 '10 at 21:49
3

Using ClientDataSet1.MergeChangeLog before saving the XML file solves the problem.

Code looks like this:

ClientDataSet1.MergeChangeLog;
ClientDataSet1.SaveToFile('c:\Test.xml',dfXML);
Bharat
  • 6,828
  • 5
  • 35
  • 56