Solved

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

Posted on 2011-09-27
3
341 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
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 26

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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

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

How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

863 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

22 Experts available now in Live!

Get 1:1 Help Now