B
Bennett Haselton
I know how to create a DataAdapter that loads data from a data source
into a table in a typed DataSet, and how to set the DataSource and
DataMember properties of a DataGrid so that at run time it will load
the data from that table in the DataSet.
Assuming I've got two tables in the DataSet, how can I set the
DataSource property of the DataGrid to be an inner join of the two
tables in the DataSet?
If I want the DataGrid to get data from just one table, I set the
DataSource property to be an instance of the typed DataSet, and the
DataMember property to be the table where I want to get the data. But
if I want to do an inner join, it's not intuitive to me what to do
instead, and none of the examples in my ASP books show how to do it.
I could create the *DataAdapter* so that it does an inner join to load
the data into the DataSet in the first place. But that's inefficient
if I'm already loading the contents of Table1 and Table2 into the
DataSet for use by some other controls on the page, then if I load a
join of Table1 and Table2 into the DataSet as well, then I'd probably
be loading the entire contents of at least one of the tables twice.
Doing a join on data already in memory seems more efficient.
-Bennett
into a table in a typed DataSet, and how to set the DataSource and
DataMember properties of a DataGrid so that at run time it will load
the data from that table in the DataSet.
Assuming I've got two tables in the DataSet, how can I set the
DataSource property of the DataGrid to be an inner join of the two
tables in the DataSet?
If I want the DataGrid to get data from just one table, I set the
DataSource property to be an instance of the typed DataSet, and the
DataMember property to be the table where I want to get the data. But
if I want to do an inner join, it's not intuitive to me what to do
instead, and none of the examples in my ASP books show how to do it.
I could create the *DataAdapter* so that it does an inner join to load
the data into the DataSet in the first place. But that's inefficient
if I'm already loading the contents of Table1 and Table2 into the
DataSet for use by some other controls on the page, then if I load a
join of Table1 and Table2 into the DataSet as well, then I'd probably
be loading the entire contents of at least one of the tables twice.
Doing a join on data already in memory seems more efficient.
-Bennett