Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
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.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

838 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