Client dataset dumping records on set of IndexName

I have been working on a bit of code that loads data from 5 sources into a client dataset.  The data can then be indexed and manipulated to update the screen.  I ran into a spot in my code, while debugging, that set the CDS FilterName.  This should not be a problem but I noticed a watch I had setup to display the RecordCount property went from 1 to 0.  Can anyone tell me why a client dataset would behave like that?
LVL 21
developmentguruPresidentAsked:
Who is Participating?
 
developmentguruConnect With a Mentor PresidentAuthor Commented:
There is no active filter at the time, I verified that.  The only change is to the index name.

I have found a work around.  It seems that if I delete all of the records on a client dataset with active indexes, then start adding records back, this happens.  Now, on each refresh, I dispose of the client dataset, recreate it, add all of the fields and indexes and create the dataset.  Once the client dataset has been recreated in it's structure I add back the records.

There is no problem now.  I was wondering if this solution might trigger any oher insights.  Is there a setting having to do with the indexing that might help?  Any other ideas?

I will leave the question open a while to give a chance for more input.
0
 
Ephraim WangoyaCommented:
RecordCount returns the count of records in the active view. Any record filtered out is not part of the count hence the difference in numbers.
0
 
Ephraim WangoyaCommented:
Hi developmentguru

Sorry could not keep up

How do you delete the records in the client dataset?
Have you tried
ClientDataset1.EmptyDataSet;
0
 
developmentguruPresidentAuthor Commented:
No other solution was provided.  This is a solution, but I would have preferred a way of getting it to work without recreating the client dataset.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.