How can I delete all the records from a TClientDataset at once?

Salvador picture Salvador · Oct 24, 2010 · Viewed 21.4k times · Source

Is possible delete all the records from a TClientDataset at once?

Answer

RRUZ picture RRUZ · Oct 24, 2010

Yes is possible, you must use the EmptyDataSet procedure.

try this

   ClientDataSet1.DisableControls;
 try
   ClientDataSet1.EmptyDataSet;
 finally
   ClientDataSet1.EnableControls;
 end;