Link to home
Start Free TrialLog in
Avatar of WesleyAlgee
WesleyAlgee

asked on

Gridview display results issue (show multiple record results in a single gridview column)

I really don't know how to ask this question so I will attempt to describe what I am needing to do. Say I have 300 units of Item A that ship in 4 different Boxes and 200 Units of Item B that ship in one box My search results would return 5 rows one for each box. This is how my gridview currently acts

Item Name           Box #
   A                        987
   A                        654
   A                        321
   A                        573
   B                        275

However this is how I would like it to display

Item Name          Box #
      A                   987, 654, 321, 573
      B                    275

is this possible and if so how do I get it to look like this (also each box number would be a link to the shipping information for that box)

Avatar of David Robitaille
David Robitaille
Flag of Canada image

ther is many way of doig this, as an exemple, you could do this in the SQl query.
here an exemple
http://databases.aspfaq.com/general/how-do-i-concatenate-strings-from-a-column-into-a-single-row.html
Avatar of WesleyAlgee
WesleyAlgee

ASKER

maybe I don't understand or maybe I did not make it clear but the information I am getting from the database are in two different tables (don't know if this makes a difference) and would it seems to me that the code you linked to would still give me five records returned instead of only two
no if you do it correctly, it would return 2 row.
It<s a long time i did not do this. I would suggest that you use the request for attention button to ask a moderator to add the "SQL Syntax" Zone and the database type you use (mysql, ms SQL server, oracle etc.)
ASKER CERTIFIED SOLUTION
Avatar of WesleyAlgee
WesleyAlgee

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial