Solved

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

Posted on 2009-05-12
5
209 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

A short article about problems I had with the new location API and permissions in Marshmallow
Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
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…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now