-1

I thought this would be simple but don't see a function that clears all records from the dataset of a TDataSource. Any ideas?

2 Answers2

1

There is no such function. You have to step through all records.

while ds.RecordCount>0 do
  ds.delete;
user3640611
  • 87
  • 2
  • 10
0

try clear the DataSet with EmptyDataSet.. Example... ds.EmptyDataSet;

  • 1
    This is only available for a `TClientDataSet`, and the poster has not indicated that a ClientDataSet is being used. – Ken White Jul 17 '15 at 15:22