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;
[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;
work the same way?
Can someone point out what I might be missing?
Thanks
Ed