【发布时间】:2018-04-03 09:25:52
【问题描述】:
我有一个包含不同种类水果和豆类的数据表(从 xls 文件填充)。
我从这个数据表中创建了一个数据视图,并使用 RowFilter 只包含土豆和西红柿。
现在,我尝试创建一个 groupby(带有“名称”列)并从另一列“数量”中求和。
其实:
Name | Quantity | color
tomatoe | 2 | red
tomatoe | 1 | red
potatoe | 5 | yellow
tomatoe | 1 | red
potatoe | 1 | yellow
我会像这样返回一个数据表或数据视图:
Name | Quantity | color
tomatoe | 4 | red
potatoe | 6 | yellow
我该怎么做?
对不起,如果这很简单,但我不喜欢那个。
【问题讨论】:
标签: vb.net datatable grouping dataview