Data Web Controls & Join SQL Queries

B

BillGatesFan

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
 
E

epigram

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top