|
-
Mar 28th, 2002, 06:47 AM
#1
Thread Starter
Member
How to display fields from multiple datatable in a datagrid
Hi,
I have a problem and would be happy if you guys out there can help me out with this.
Let say I have 2 tables. One of them is "Customer" and another is "State".
The "Customer" table has a field which is linked to the "State" table using relationship.
Usually in VB6, I would open a recordset using the "JOIN" statement and bind it to a datagrid.
In VB .NET, if I don't want to use the "JOIN" statement but to open the 2 tables in a dataset, how do I display the data correctly in a datagrid?
To make the picture clear, so here goes,
*** Data in the 2 tables ***
Customer Table
--------------------
CustomerID: 1
Name: Peter
StateID: 1
CustomerID: 2
Name: John
StateID: 2
State Table
--------------
StateID: 1
Name: Virginia
StateID: 2
Name: Ohio
*** The result I wanted to be displayed in the datagrid ***
Code:
+----------+----------+
| Name | State |
+----------+----------+
| Peter | Virginia |
| John | Ohio |
+----------+----------+
Thanks in advance
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|