我想按名称、姓氏对数据表进行分组,其余的应该在同一行。有人可以帮我吗?
我的数据表:
Name LastName 1 3 2
kiki ha FF
lola mi AA
ka xe UU
kiki ha SS
我想按名称对 DataTable 进行分组:
Name LastName 1 3 2
kiki ha FF SS
lola mi AA
ka xe UU
我的新代码:
var result11 = from t1 in newtable.AsEnumerable()
group t1 by new { Name = t1.Field<String>("Name"), LastName = t1.Field<String>("LastName") } into grp
select new
{
Name = grp.Key.Name,
LastName = grp.Key.LastName,
//Something must be there
};