Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2009-05-12
5
Medium Priority
?
219 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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Progress

971 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