Solved

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

Posted on 2011-09-27
3
352 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
[X]
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
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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

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.
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
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…

717 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