Group By

  • Thread starter Achim Domma (Procoders)
  • Start date
A

Achim Domma (Procoders)

Hi,

I have a resultset with different columns which I would use to group the
data by. For examle:

Name Categ Year
AAA 1 2003
BBB 1 2004
CCC 2 2003
DDD 2 2004

I want to have differnt views of this data like this:

1 - 2003 - AAA
2004 - BBB
2 - 2003 - CCC
2004 - DDD

or

2003 - AAA
CCC
2004 - BBB
DDD

I could solve this using multiple queries and differnt filters, but I
wonder if there is a more elegant solution using ADO.Nets hierarchical
features. And hints or ideas?

regards,
Achim
 
A

Adrian Moore

Achim,

If you are looking to do the eqivalent of a GROUP BY in a SELECT query
against your result-set, you might want to try the assembly I've been
working on at http://www.queryadataset.com. It lets you perform complex SQL
SELECT statements including UNION, JOINS, GROUP BY, HAVING, ORDER BY,
sub-queries, etc against the tables in a dataset.

The web-site allows you to upload your own XML data fragment, DataSet or
resultset and issue queries using the QueryADataSet assembly. If the query
returns the results you expect, then this assembly might be what you are
looking for. Note the result of any query from this assembly is a standard
DataView object.

Hope this helps
Ad.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top