c# - Datatable group by issue r.Field<T> -
i searching datatable group option , found solution in stackoverflow.
datatable t = // var groups = t.asenumerable() .groupby(r => r.field<t>("columnname"))
what mean... r.field<t>
. why field<t>
?
can't here specify r.field<customer>
.
read http://blogs.msdn.com/b/adonet/archive/2007/02/05/type-safety-linq-to-datasets-part-2.aspx
edited:
1) why field?
field<t>
method : datatable not typed one,the values saved object. field method returns value of column generic type parameter, enable type checking.
if typed datatable can field<customer.id>
- -
Comments
Post a Comment