Select TOP 5 * from SomeTable, using Dataview.RowFilter?(使用 Dataview.RowFilter 从 SomeTable 中选择 TOP 5 *?)
问题描述
我需要从缓存的 Dataview 对象中选择最近的 5 行,有什么办法吗?
I need to select 5 most recent rows from cached Dataview object, is there any way to do that?
我试过了,但是 Indexer DataColumn 是空的.:
I've tried but Indexer DataColumn is empty. :
getAll() 返回缓存的 DataView
getAll() returns cached DataView
谢谢
推荐答案
我在 这篇文章,但最后一篇文章说提供的代码不起作用.
I encountered the same sample above in this article, but the last post says the provided code doesn't work.
但是,这篇文章有一个可行的解决方案,所以这里是您可以使用的代码:
However, this article has a solution that does work, so here's the code you could use:
这篇关于使用 Dataview.RowFilter 从 SomeTable 中选择 TOP 5 *?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!