I have a requirement where i want to Group Data in the DataTable & Aggregate Other Columns according to the Grouped Columns in C#.
this is a common code so, Query, Columns & Data in the Datatable is not known to me before execution of the Function.
I found two options :
1) Using DataSetHelper Class as Shown in this article
but this will take time to execute as it loops thru all the Rows in the DataTable & my Datatable contains mre than 10000 rows.
2) using LINQ.
this is better option if i know the LINQ Query which is not the case with me i dont even know that how many columns will be used for Grouping & how many will be used for aggregation (also which column will use sum,count or avg)
is there any way i can create a LINQ as a String at Runtime & run it??????
or is there any other solution which is faster & better than the Option - 1.