Get all values of a column from a DataSet(从 DataSet 中获取列的所有值)
问题描述
在 C# 中,是否可以通过简单指令(无 LINQ,无 For cicle)从 DataSet 的所有行中获取特定列的所有值?
In C#, is it possible to get all values of a particular column from all rows of a DataSet with a simple instruction (no LINQ, no For cicle)?
推荐答案
仅通过遍历行,如 Utaal 在这个答案中注明.
您可能期望 DataTable.DefaultView.RowFilter
会支持分组,但它不支持(它主要提供 Where
子句的等效功能,以及一些基本的聚合 - 虽然不是简单的分组).
You might expect that the DataTable.DefaultView.RowFilter
would support grouping, but it does not (it mainly offers the equivalent functionality of a Where
clause, with some basic aggregations - though not simple grouping).
这篇关于从 DataSet 中获取列的所有值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!