与Dataview分组 [英] Group by with Dataview

查看:508
本文介绍了与Dataview分组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在使用下面的LINQ查询,该查询返回一个Dataview.

Hi,
I am using the below LINQ query which returns a Dataview.

SampleDataView = (from a in sometable
                                        where
                                            ID.Any(s => s == a.SecID)
                                        orderby
                                            a.SecID
                                        select
                                            a
                                  )
                                  .AsDataView();


现在我想在secId字段上应用分组依据,但是它不返回dataview .....


Now I want to apply Group by on secId field , but it doesn''t returns dataview.....

SampleDataView = (from a in sometable
                                        where
                                            ID.Any(s => s == a.SecID)
                                       group a by 
                                            a.SecID into b
                                        select
                                            b
                                  )
                                  .AsDataView()


还有其他方法可以进行分组并获取数据视图.

P.S id是一个列表,仅用于过滤数据.

谢谢,
Ashish.


Is there any other way to do the group by and get the data view.

P.S Here id is a list which just help filter the data.

Thanks,
Ashish.

推荐答案

看看 [^ ]


这篇关于与Dataview分组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆