Hi Gloria,
Indeed, what you're missing is a somewhat smart DataView. Well, so far, this
is not around. There was an example on MSDN of a DataView that did this
(very simple and only for limited use, but maybe with some modifications it
fits your needs, anyway, I couldn't find it anymore, maybe someone has a
link to that page, again.).
Right now, I could imagine those solutions:
1) implement ITypedList and IBindingList: that's what was in that article
2) write a (sorry) ugly methode that creates a new table out of two tables
(of course that method can be generic and doing your equijoin by using the
meta information of the Dataset and some input about which tabels should be
joined...)
3) use expression columns in your dataset (create a new table based on
expressions or modify an existing one to kind of get the data from the other
table with an expression... which is, in my opinion, a flat construct of a
derived attribute)
number 1) and 3) work fine and are not so ugly, even when you manipulate the
data, anyway, number one get's tricky if you want to have a good runtime
behavior because of some implementation details. Number 3) looks kind of
ugly but I think for the moment if possible, it's the easiest solution. Note
that you get some compile time suport (syntactical checks, I think no
semantic checks) when using the typed dataset and the VS.NET dataset
designer.
finally it's worth thinking over if you really need to join your data in the
application or application server or if it's in this case not possible to
let the db do this work. We found that it's a tricky task to decide which
ones are your business entities and to decide where you need some (we say)
use case specific "business entites".
regards
Christian