DataTable dt= dbhelp.Query(sql).Tables[0];
IEnumerable<IGrouping<string, DataRow>> result = dt.Rows.Cast<DataRow>().GroupBy<DataRow, string>(dr => dr["A"].ToString());//按A分组
foreach (IGrouping<string, DataRow> ig in result)
{
string s = ig.Key; A
int i= ig.Count(); A类型笔数
}

  



posted on 2019-05-15 18:31  e度空间  阅读(259)  评论(0编辑  收藏  举报