I need to sort ANY TDataset descendant - my first idea is to:

I need to sort ANY TDataset descendant - my first idea is to:

First look for IndexFieldNames property using RTTI - if found use it to sort TDataset.

If property IndexFieldNames doesn't exists

Create temporary TClientDataset - copy data from my TDataset and sort it using TClientDataset.indexFieldName. Sorted data copy back to TDataset.

Maybe you have better ideas?

Comments

  1. Iman Crawford, you can work around that by building sorted temp tables, but that is really inefficient.

    ReplyDelete
  2. Of course there are work arounds. Casting to known TDataset descendants and using their sorting methods.

    ReplyDelete
  3. Also, a dataset might be huge, as in several million records and stored on a server with a very slow connection.

    ReplyDelete

Post a Comment