Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27474

VS 2010 I am completely lost on this. How to organize queries?

$
0
0
I am attempting to populate a listbox with data in 3 separate tables, but it keeps just putting each entry on 1 line rather than creating new lines. These are the tables:

Attachment 96993

This is what the output should look like:

Attachment 96995

This is what my output looks like:

Attachment 96997

Here's my code:
Code:

Dim query2 = From customers In MICROLANDDataSet.Customers
                    Join orders In MICROLANDDataSet.Orders
                    On customers.custID Equals orders.custID
                    Join inventory In MICROLANDDataSet.Inventory
                    On inventory.itemID Equals orders.itemID
                    Order By customers.custID Ascending
                    Select customers.name & " " &
                    customers.street & " " &
                    customers.city & " " &
                    orders.quantity & " " &
                    inventory.description & " " &
                    inventory.price _
                    Distinct
        lstOutput.Items.Clear()
        lstOutput.Items.AddRange(query2.ToArray)

Any VB gurus able to chime in on what on earth I need to do? I do NOT understand queries, databases, or VB enough to get this on my own. :blush:
Attached Images
     

Viewing all articles
Browse latest Browse all 27474

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>