?
Solved

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

Posted on 2011-09-27
3
Medium Priority
?
362 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 2000 total points
ID: 36716426
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 27

Expert Comment

by:Shaun Kline
ID: 36716440
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
ID: 36717797
This is what is needed
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

850 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