in ADO.net 2.0 beta 2
I know how to do the parent-child type.
1. drag a DataGrid control in a window form, get a datasource from
table cust.
2. drag table cust onto the DataGrid.
3. in the data window, right-click the dataset, select configure..
adding table o.
4. drag the child table onto the DataGrid control.
comment: With this way, I build this without a coding. I believe it is
MVC style.
I do not know the steps to join two relational tables into one ADO
table.Please advise. Thanks.
Peter

Re: ADO.net 2.0, beta 2, how to get data from 2 tables, not parent-chi by Sahil

Sahil
Wed Oct 05 23:19:53 CDT 2005

If you want a single datatable driven out of two database tables, the best
way to do that is to simply execute a join query on the database.

If you wish to combine two datatables to give you one single datatable, the
best way to do that is to iterate over values of both tables and use the
LoadDataRow method.

- Sahil Malik [MVP]
ADO.NET 2.0 book -
http://codebetter.com/blogs/sahil.malik/archive/2005/05/13/63199.aspx
----------------------------------------------------------------------------


"Peter" <Peter@discussions.microsoft.com> wrote in message
news:BA3B8586-EE2B-4427-8EAA-D5520069228D@microsoft.com...
> in ADO.net 2.0 beta 2
> I know how to do the parent-child type.
> 1. drag a DataGrid control in a window form, get a datasource from
> table cust.
> 2. drag table cust onto the DataGrid.
> 3. in the data window, right-click the dataset, select configure..
> adding table o.
> 4. drag the child table onto the DataGrid control.
> comment: With this way, I build this without a coding. I believe it is
> MVC style.
> I do not know the steps to join two relational tables into one ADO
> table.Please advise. Thanks.
> Peter



Re: ADO.net 2.0, beta 2, how to get data from 2 tables, not parent-chi by Cor

Cor
Thu Oct 06 04:06:34 CDT 2005

Peter,

If it is a one to one relation you can use the merge.

Be aware that the keys have to be equal and that the collecting table has to
have all columns you need (probably is the best to do two merges in a new
created datatable).

(I don't think that you can do this with drag and drop)

Here a simple sample that can lead you in my opinion to your solution.

http://www.windowsformsdatagridhelp.com/default.aspx?ID=edb1409d-5394-468f-a63f-de3a5d92b14a

I hope this helps,

Cor