Solved

How to use one Gridview to list two SQL Database tables consecutively

Posted on 2011-09-27
3
339 Views
Last Modified: 2013-12-25
I have two tables with 3 columns.  Each tables represents different types of the same entity (Shoes) so they have the same types of attributes.  

eg. Columns
Table 1: BootID, BootName, BootSize
Table 2: SneakerID, SneakerName, SneakerSize

They are related through table 3, the store table where BootID and SneakerID are foreign keys.

eg. Columns
Table 3: StoreID, BootID, SneakerID, StoreLocation

How do you display the shoes in one Gridview?

eg. Columns: Shoes Name, Shoe Size
eg. Values: BootName1, 7
                   BootName2, 10
                   SneakerName1, 11
                   SneakerName2, 10

Thanks in advance.
0
Comment
Question by:Timbilt
3 Comments
 
LVL 28

Accepted Solution

by:
sybe earned 500 total points
Comment Utility
I would say, solve it with a query using INNER JOIN.

But actually your examples make not much sense to me. Why do you have two tables for the same entity? And what is the nature of their relationship in the third table?

Maybe you need a "UNION ALL" ?
0
 
LVL 25

Expert Comment

by:Shaun Kline
Comment Utility
I agree with sybe.
If you are still in design mode, consider having one table and add a column to define the type of shoe.

Otherwise, a UNION ALL would be needed. You may also need to have a value to each component of the UNION to distinguish the type of shoe to your application.
0
 

Author Closing Comment

by:Timbilt
Comment Utility
This is what is needed
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now