开发者

Filter DataTable to show only the most recent transaction for each user

I have a datatable that contains rows of transaction data for multiple users. Each row includes UserID and UserTransactionID columns. What would I use for as a Ro开发者_如何学运维wFilter in the tables DefaultView to only show the row for each user that has the highest UserTransactionID value?

sample data and results

UserID  UserTransactionID PassesFilter
1       1                 False
1       2                 False
1       3                 True
2       1                 True
3       1                 False
3       2                 True

My data is orginating in a non-SQL source, the DataTable is being created to be bound to a DataGridView so I can't make changes to a query being used to get the data initially.


Create a derive table (with a LINQ query). Filtering won't work here.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜