Querying across tables in a dataset

  • Thread starter Elizabeth Strachan
  • Start date
E

Elizabeth Strachan

This is my biggest dissapointment with ADO.NET. I quote:

"You cannot use a DataView to join data between two
DataTable objects, nor can you use a DataView to view
only certain columns in a DataTable." David Sceppa,
Microsoft ADO.NET book.

Got caught with the fine print on this one, and I was
sooo excited when I first heard about datasets too! :(

Seriously though, yes you will probably need to get ugly
with manual coding but to point you in the right
direction Microsoft already have written some kb articles
to allow you to join tables in memory and pull out a
subset of both tables into a new datatable (sorted and
filtered). This could probably be adapted to work across
3 or it might be easier for you to join 2 and then join
result with 3rd to produce what you want.
The kb article numbers are:
326080 - C#
325688 - VB.Net

If you need the links are below:
http://support.microsoft.com/default.aspx?scid=kb;en-us%
3b326080
http://support.microsoft.com/default.aspx?scid=kb;en-us%
3b325688

And yes, I too cringed at first but it actually seems to
perform pretty well (mind you though I have a heap of
RAM!).

Hope this helps,
Elizabeth Strachan
 

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