A simple nested datagrid (vb.net)?

V

Vili

Hi all

What is the best way to do a simple nested datagrid?
I have a tableA with personID, first name and last. TableB with
information on personID. I am looking for a way to bring
name values on a datagrid and when selected it would show person
information.

Like this:

William Tom 01
Lorens Jack 02
Nash Mike 03

When selected Lorens Jack ->

William Tom 01
Lorens Jack 02
Info Info Info
Info Info Info
Info Info Info
Info Info Info
Nash Mike 03

Tuomo
 
J

Juan T. Llibre

That is done in the SQL statement.

You need to JOIN on the key field present in both tables.
 
V

Vili

Juan said:
That is done in the SQL statement.

You need to JOIN on the key field present in both tables.

But that would just get me

William Tom 01
Lorens Jack 02 Info Info Info Info Info Info
Lorens Jack 02 Info Info Info Info Info Info
Lorens Jack 02 Info Info Info Info Info Info
Nash Mike 03

or?

Here is an example what I found
http://www.standardio.org/article.aspx?id=155

But I had some problems with that.
 
J

Juan T. Llibre

That example you point to uses *exactly* what I said you should use :

strSQL &= "FROM Employees INNER JOIN "
strSQL &= "Orders ON Employees.EmployeeID = Orders.EmployeeID INNER JOIN "
strSQL &= "Customers ON Orders.CustomerID = Customers.CustomerID INNER JOIN "
strSQL &= "[Order Details] ON Orders.OrderID = [Order Details].OrderID INNER JOIN "
strSQL &= "Products ON [Order Details].ProductID = Products.ProductID "
strSQL &= "WHERE Employees.EmployeeID = " & x & " ORDER BY orderdate DESC"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,280
Latest member
BGBBrock56

Latest Threads

Top