views:

802

answers:

1

I have the exact same question as this one: http://stackoverflow.com/questions/831519/aggregate-functions-in-ado-net-with-group-by-functionality/1084230

however the proposed solution was for .net 3.5 but I am using .Net 2.0 so I cant the LINQ query. To summarize: I have a DataSet and I want to create a view from it and apply something similar to the "GROUP BY" functionality of SQL, so that the rows are grouped by certain criteria and I then apply the aggregate functions on this group

A: 

I don't have a complete answer, but I bet you could create a new DataTable and add it to the DataSet. You could then add columns to the new table for the key values you want to group on. then create a relation between it and the original table: make the new table the parent. Then add computed columns to the table for everything you want to aggregate on. These columns can now use "SUM(Child.ColumnName)" to do the aggregations.

Or, at least I think that might work!

John Saunders