I have the following datatable :
id name name_in
3 sys sys
5 con con_r
5 con con_s
5 con con_g
I want to get the following datatable from it :
3 sys
5 con
How to do this?
I do the following
var groups = Process_dt.AsEnumerable()
.GroupBy(r => r.Field<Int16>("id"));
but how to put the result in another datatable .
GroupBy will return you an IGrouping collection which you can iterate the following way: