A
Aaron
Hi,
It is possible to establish relationships between tables within a
dataset and this allows some useful features. For example, given a row
from a table you can use GetParentRow, GetParentRows, GetChildRows.
However, I don't see a good way to represent data from multiple dataset
tables within a single datagrid (although I can think of at least one
bad way). For example, if you have a Invoice table which instead of
having an company address, simply has a foreign key to an Address
table, but when the data is displayed in a grid, you want Invoice info
and the Address info to appear as 1 record. In the examples that I
have read, if data from multiple tables is required in this way, the
data is actually obtained by giving the SelectCommand a query that
includes the proper SQL statement with joins, etc. In this case, the
data from multiple tables is combined at the server and arrives within
the VB application as a single table. While this is useful, I would
like to see if it is possible to combine data from multiple dataset
tables.
Since the dataset approximately represents a database, what I imagine
for the solution would be some way to generate a new dataview that
would aggregate the data together based on a SQL-like statement that I
passed to a dataset method. This would also be different from writing
code that will generate a new combined table from scratch that if any
changes were made, the dataview would also be updated by changes in the
tables it was build from (I suppose you could also write code that
would update the generated table but would like to find a better way if
possible).
Also, I have noticed it is possible to set the datasource of a grid to
an entire dataset, but this does not produce the results I want.
Thank you,
Aaron
It is possible to establish relationships between tables within a
dataset and this allows some useful features. For example, given a row
from a table you can use GetParentRow, GetParentRows, GetChildRows.
However, I don't see a good way to represent data from multiple dataset
tables within a single datagrid (although I can think of at least one
bad way). For example, if you have a Invoice table which instead of
having an company address, simply has a foreign key to an Address
table, but when the data is displayed in a grid, you want Invoice info
and the Address info to appear as 1 record. In the examples that I
have read, if data from multiple tables is required in this way, the
data is actually obtained by giving the SelectCommand a query that
includes the proper SQL statement with joins, etc. In this case, the
data from multiple tables is combined at the server and arrives within
the VB application as a single table. While this is useful, I would
like to see if it is possible to combine data from multiple dataset
tables.
Since the dataset approximately represents a database, what I imagine
for the solution would be some way to generate a new dataview that
would aggregate the data together based on a SQL-like statement that I
passed to a dataset method. This would also be different from writing
code that will generate a new combined table from scratch that if any
changes were made, the dataview would also be updated by changes in the
tables it was build from (I suppose you could also write code that
would update the generated table but would like to find a better way if
possible).
Also, I have noticed it is possible to set the datasource of a grid to
an entire dataset, but this does not produce the results I want.
Thank you,
Aaron