DataSet question

  • Thread starter Thread starter Tommy Lang
  • Start date Start date
T

Tommy Lang

I am creating a database application that uses the dataset.
The dataset holds three different tables.
I can access each table, no problem there. But how can I combine
data from the different tables into a new table.
Should/could I use views, relations ? It is possible to send an sql
query to my dataset?

I am hoping to avoid having to save the data in the dataset to my
database and then send a sql question down to the database and reload
everything.

Thanks
/Tommy
 
Tommy,

It would be possible to create a new table where the column expressions
reference the columns in the other tables. I believe that if the values are
changed in the table, the calculated columns will have the correct value.

You can not feed a select statement to the DataTable. However, you can
call the Select method, passing in filters, which I believe can reference
related tables.

Hope this helps.
 
Hi Nicholas and Tommy,

Nicholas Paldino said:
Tommy,

It would be possible to create a new table where the column expressions
reference the columns in the other tables. I believe that if the values are
changed in the table, the calculated columns will have the correct value.

I would recomended expressions only for read-only data. If you have
editing - avoid them.
Create another table, copy the data from tables into it.
You might take a look at
HOW TO: Implement a DataSet JOIN helper class in Visual C# .NET
http://support.microsoft.com/default.aspx?scid=kb;en-us;326080&Product=adonet
 
Back
Top