Solved

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

Posted on 2009-05-12
5
212 Views
Last Modified: 2012-05-11
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)

0
Comment
Question by:WesleyAlgee
  • 2
  • 2
5 Comments
 
LVL 18

Expert Comment

by:David Robitaille
ID: 24366564
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
0
 

Author Comment

by:WesleyAlgee
ID: 24367834
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
0
 
LVL 18

Expert Comment

by:David Robitaille
ID: 24368047
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.)
0
 

Accepted Solution

by:
WesleyAlgee earned 0 total points
ID: 24560178
Follow this link to see how I found my answer to this question I guess I worded the question better there

http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/Q_24406293.html
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

810 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