|
 |
asp_web_howto thread: How do I display my records without repeating some information?
Message #1 by "Lucy Robinson" <lucy@v...> on Fri, 7 Feb 2003 10:11:02
|
|
Hi there
Please could someone help me with the following problem.
I have a database full of products, and a list of manufacturers that are
associated with each of these products. There can be more that one
manufacturer associated with each product. These products can be added to
a basket by a user, and they then get sent an email with what they've
ordered.
At the moment, when I output my information to an email, the user sees the
following:
office furniture - manufacturer a
office furniture - manufacturer b
office furniture - manufacturer c
office furniture - manufacturer d
This is because there are 4 manufacturers associated with this one
product.
What i would like to be able to do is this:
office furniture - manufacturer a, manufacturer b, manufacturer c,
manufacturer d
i.e. the product is only mentioned once, and then the manufacturers are
listed afterwards. I think this would be nicer for the end user.
I'm pretty new to ASP and would really appreciate some help with this. If
you could explain how I do this, with the coding i would need, then that
would be fantastic.
Thanks in advance
Lucy
Message #2 by "Ken Schaefer" <ken@a...> on Mon, 10 Feb 2003 10:48:33 +1100
|
|
Suppose your recordset contains two columns. The "Product Name" and the
"Manufacture Name".
You store the first "Product Name" in a variable. For each product, you see
if the name is the same as what you have stored. If it is the same, just
write out the manufacturer name. If it is different, then you need to (a)
write out a new product name heading, (b) write out the manufacturer name
and (c) update the variable.
I realise this is a small logical problem (ie it's not trivial), but getting
out a piece of paper and doodling a quick diagram often helps sort out what
you need to do.
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Lucy Robinson" <lucy@v...>
Subject: [asp_web_howto] How do I display my records without repeating some
information?
: Hi there
:
: Please could someone help me with the following problem.
:
: I have a database full of products, and a list of manufacturers that are
: associated with each of these products. There can be more that one
: manufacturer associated with each product. These products can be added to
: a basket by a user, and they then get sent an email with what they've
: ordered.
:
: At the moment, when I output my information to an email, the user sees the
: following:
:
: office furniture - manufacturer a
: office furniture - manufacturer b
: office furniture - manufacturer c
: office furniture - manufacturer d
:
: This is because there are 4 manufacturers associated with this one
: product.
:
: What i would like to be able to do is this:
:
: office furniture - manufacturer a, manufacturer b, manufacturer c,
: manufacturer d
:
: i.e. the product is only mentioned once, and then the manufacturers are
: listed afterwards. I think this would be nicer for the end user.
:
: I'm pretty new to ASP and would really appreciate some help with this. If
: you could explain how I do this, with the coding i would need, then that
: would be fantastic.
:
: Thanks in advance
:
: Lucy
Message #3 by "Andrew Webster" <y5yxy@y...> on Fri, 14 Feb 2003 18:49:38
|
|
What database are you using? If you're using SQL Server (or
another 'proper' database) you could return the data using a stored
procedure. This stored procedure would call a function which would create
the concatenated manufacturer list for you.
Let me know if this helps.
Cheers,
Andy Webster
RedHat Solutions Ltd
|
|
 |