I have a query that needs to be dynamic, I think most of my syntax is right but I do not know how to give it the name of the column I want to group by. I have tried a few different approaches and I always get an error - "No property or field 'name' exists in type 'datarow'
IQueryable<Result> aggregate1 =
query1Data.Tables[0].AsEnumerable().AsQueryable()
.GroupBy("name", "it")
.Select<Result>("new(Key as Group, Sum(value)as Total)");
I assume I have to use something like Field<string>("name")
but I cant figure it out. I have seen the problem on a few forums but no one seems to have a clear answer how to get around the problem.