473,508 Members | 2,006 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Data Web Controls & Join SQL Queries

I'd like to know if there is a best approach, in terms of using the Data Web
Controls (i.e. DataGrid, DataList & Repeater), for displaying data that is
the result of a query that joins two tables that have a one-to-many
relationship. For instance if I perform a query on two such tables, I might
expect that there would be data repeated on multiple rows from table on the
one side of the relationship. What I want to do is display an HTML table
row, or something similar, (using one of the Data Web Controls) on a web
page for each "group". A group being the set of rows that has the same
repeated data (dictated by the join).

For example, I might have a Company table and an Employee table. If I do a
query joining these two (assuming some design decisions here), I'd have
company data repeated in many rows for each employee that works for that
company. I'd like to display the data in a row-based design on a web page
that, for each display row, has the company data once and then the employee
data for each employee that works for that company. So, the display would
be (conceptually) something like this:

ACME Works Ltd. New York, NY

John Doe - hired: 7/8/1986
Jane Smith - hired: 9/1/2004
Bob Harris - hired: 3/5/2002

---------------------------------------------

ABC Company Inc. San Diego, CA

Bob Smith - hired: 3/7/1999
Judy Davis - hired: 3/9/2002
John Roberts - hired: 2/3/2004

---------------------------------------------

.....

So, each "visual row" is really comprised of multiple records in the query's
result set. This is where my confusion comes in. Most of the example I
have seen with the Data Web Controls seem to have a one-to-one relationship
between a record from a query and a "visual row". There may be some
treatment of the data (i.e. change the color, make it a link), but I haven't
specifically seen an example of what I want to do. Maybe I have to do this
from scratch, but I'd like to avoid that.

Any help on how this should be accomplished would be much appreciated.
Thanks!
Nov 19 '05 #1
1 1212


Are you talking about a parent - child list of data. The company being
the parent and the employee table being the child? I think you want to
use a datagrid to display the data. Do a search on Master-Detail
Datagrids

epigram wrote:
I'd like to know if there is a best approach, in terms of using the Data Web Controls (i.e. DataGrid, DataList & Repeater), for displaying data that is the result of a query that joins two tables that have a one-to-many
relationship. For instance if I perform a query on two such tables, I might expect that there would be data repeated on multiple rows from table on the one side of the relationship. What I want to do is display an HTML table row, or something similar, (using one of the Data Web Controls) on a web page for each "group". A group being the set of rows that has the same repeated data (dictated by the join).

For example, I might have a Company table and an Employee table. If I do a query joining these two (assuming some design decisions here), I'd have company data repeated in many rows for each employee that works for that company. I'd like to display the data in a row-based design on a web page that, for each display row, has the company data once and then the employee data for each employee that works for that company. So, the display would be (conceptually) something like this:

ACME Works Ltd. New York, NY

John Doe - hired: 7/8/1986
Jane Smith - hired: 9/1/2004
Bob Harris - hired: 3/5/2002

---------------------------------------------

ABC Company Inc. San Diego, CA

Bob Smith - hired: 3/7/1999
Judy Davis - hired: 3/9/2002
John Roberts - hired: 2/3/2004

---------------------------------------------

....

So, each "visual row" is really comprised of multiple records in the query's result set. This is where my confusion comes in. Most of the example I have seen with the Data Web Controls seem to have a one-to-one relationship between a record from a query and a "visual row". There may be some
treatment of the data (i.e. change the color, make it a link), but I haven't specifically seen an example of what I want to do. Maybe I have to do this from scratch, but I'd like to avoid that.

Any help on how this should be accomplished would be much appreciated. Thanks!


Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1060
by: Vik | last post by:
I use the same dataadapters and datasets on a few aspx pages. Currently I create these data controls on each page. Is it possible to create these controls only once and then use them on the...
2
9600
by: | last post by:
I've defined an ObjectDataSource against a dataset, and I can bind the ObjectDataSource's members to data controls. I'm wondering how to take the values in an ObjectDataSource and...
5
2174
by: yma | last post by:
Hello, I tried to display a column in MS Access 2000 nwind.mdb using 3 data controls. But I got "It is already opened exclusively by another user, or you need permission to view its data." I...
0
856
by: Mehdi | last post by:
I have implemented custom data entity objects, so I like to bind my entities to web server data controls, so I want to know what extra code I should implement to to do that?
1
1400
by: C4rtm4N | last post by:
I'm about to embark on re-writing a database & bespoke web reporting application for our call centre & would like a little advice please. Currently the database has 10 tables containing summaried...
2
1782
by: Jim Gregg | last post by:
Hello all, I am faced with some logic that I am unsure how to handle. Imagine that I am running a WMI query and I am outputting the data into a dynamically created ASP table control. Here is my...
0
817
by: =?Utf-8?B?RGFu?= | last post by:
I am relatively new to ASP.NET 2.0. I did not program in 1.1. It seems as though the new Data Controls (drag and drop in Visual Studio) have been a big imrovement, from what I've read. In many...
3
1283
by: Mirnes | last post by:
Hello! How can I show data outside of data controls (gridview, listview etc.). I want to build CSS menu with data from database table and that is the reason why I need it outside of any data...
0
1073
by: BobLewiston | last post by:
Also, can anybody recommend good online courses for SQL and/or data controls? (I guess I should master the regular data controls before going on to Silverlight, right?)
0
7226
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7328
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
5631
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5055
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4709
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3186
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1561
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
767
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
422
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.