我在使用 TClientDataSet
时遇到问题。在 DataSet
上,我的 SQL 的 order by
子句工作正常,但是当我使用 TClientDataSet
时,记录按数据库的顺序显示id
字段。
我做错了什么?
最佳答案
您的问题在 TDataSetProvider
,不在 TClientDataSet
中本身。
尝试设置poRetainServerOrder
TDataSetProvider.Options
中标记为 True
属性:
Signals that the client should not attempt to re-establish the default order by sorting the records in the data packet. This prevents the client from changing the record order because, for example, it is unable to duplicate the locale on the server.
关于delphi - ClientDataSet 上的 Order by 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49566781/