EntityDataset reverse order

Discussion of open issues, suggestions and bugs regarding EntityDAC
Post Reply
ewong
Posts: 21
Joined: Thu 20 Jan 2011 01:22

EntityDataset reverse order

Post by ewong » Tue 30 Mar 2021 04:49

Hi,

I have a TEntityDataset that's linked to a mysql database via EntityDAC connection/model. There is an ID column which is indexed.

I have read viewtopic.php?f=8&hilit=reverse%20order ... c9ac012e80.

I did the following:

Code: Select all

   recentinfoconnection.ConnectionString := '<connection string>';
   recentinfoconnection.Connect;
   recentinfo := Linq.From(recentinfocontext['RecentInfo']).Select;
   recentinfodataset.SourceCollection := RecentInfoContext.GetEntities(recentinfo);
   recentinfodataset.IndexFieldnames := 'Id desc';
   recentinfodataset.Open;
And while it runs, the order of the table is still ascending.

[Edit]
I noticed that for some reasons, I didn't have an ID index available; so I thought this was the issue. I used dbForge studio to create an ID index for the table.

However, it still didn't work. I tried this with a TUniTable + TUniConnection + TDatasource+ TDBGrid,

Code: Select all

   unicon.connectionstring := '<connection string>';
   unicon.connect;
   unitable1.connection := unicon;
   unitable1.table := 'recentinfo';
   unitable1.indexfieldnames := 'Id desc';
   unitable1.first;
   datasource1.dataset := unitable1;
   dbgrid1.datasource =datasource1;
   unitable1.active := True;
The above snippet works, so I know that the index works. Does TEntityDataset's IndexFieldNames not
work the same way?

Can someone point out what I might be missing?

Thanks

Ed

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: EntityDataset reverse order

Post by MaximG » Mon 06 Sep 2021 13:13

For technical reasons, we received the messages sent by you with a long delay. Thank you for the information, however, it's not enough to reproduce the issue. Please compose and send us a simplest sample, execution of which causes the issue. In addition, we will need the model (*.enml) used in this sample

Post Reply