• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 509
  • Last Modified:

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?
0
developmentguru
Asked:
developmentguru
  • 2
  • 2
1 Solution
 
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
 
developmentguruAuthor 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:
Hi developmentguru

Sorry could not keep up

How do you delete the records in the client dataset?
Have you tried
ClientDataset1.EmptyDataSet;
0
 
developmentguruAuthor 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

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now