Board index » off-topic » Simple TClientDataSet question

Simple TClientDataSet question


2005-11-17 11:08:03 AM
off-topic17
When using a TClientDataSet, is there a "best" way to clear out all the
data and metadata and restart it from the way it was when it was first
created.
I have a TClientDataSet with Fields and data defined. I want to clear
it all out and start with different fields and data.
Currently, I can either destroy my copy and re-create it, or clear out
the fields, field defs, indexes, etc....
Is there a prefered method, or shorter method (like ClearAll) that can
be used.
 
 

Re:Simple TClientDataSet question

with MyCDS do
begin
EmptyDataSet;
FieldDefs.Clear;
IndexDefs.Clear;
end;
--
Bill Todd (TeamB)
 

Re:Simple TClientDataSet question

Bill Todd wrote:
Quote
with MyCDS do
begin
EmptyDataSet;
FieldDefs.Clear;
IndexDefs.Clear;
end;
Do those steps also clear filters and ranges?
 

{smallsort}

Re:Simple TClientDataSet question

Yes.
--
Bill Todd (TeamB)
 

Re:Simple TClientDataSet question

Bill Todd wrote:
Quote
Yes.
Thanks Bill.