Is it possible to create something like a
"TableView" that "Joins" two
tables from a dataset? (I know there is not such a thing as
TableViews, but
it sort of helps me explain since with a Dataview this can
not be achieved).
Something equivalent to using the SQL select statement:
SELECT Table1.Field1, Table1.IDParent, Table2.IDChild
FROM Table1 INNER JOIN
Table2 ON Table1.IDParent =
Table2.IDChild
I have a dataset with two tables that I want to relate
through a Join
statement and bind the resulting table to a DataGrid so that
I have
information from both tables in each row. I have goggled
this and the
solution is to use a DataAdapter to get the resulting table
from the SQL
Database. I don't want to go that path. The reason is that
I already have
the two tables in the dataset (which I am already using
separately on
separate dataviews and databindings) and if I import them
again, they will
behave as different tables and the changes in one will not
reflect the
changes in the other tables. Additionally, having two times
the same data
will waste memory unnecessarily
If I can join them from the DataSet, put them in a DataView
and bind them to
the datagrid, the changes made (I hope) will be reflected in
each table in
the dataset. Of course, the changes made to each table
through any other
dataview will affect the tables as well.
Any ideas on how I can achieve this using "only"
the tables from the
dataset? I was hopping the DataViewManager would have this
functionality,
but apparently it does not.
Thanks,
Mauricio
===================================
This list is hosted by DevelopMentorŪ http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|