Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 31st, 2007, 10:51 AM
Authorized User
 
Join Date: Oct 2007
Location: , , .
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default DataGridView Loop

Hi,

I have a DataGridView and I want to display all testID's on one row that have the same securityID.

In the database the data is...
testID securityID
id1 56666
id2 56666
id3 56666
id4 56788

So want the output to be...

TESTID SECURITYID
id1,id2,id3____56666
id4__________56788

Do I do this using a Loop? How do I go about it?

Thanks.
  #2 (permalink)  
Old November 1st, 2007, 12:07 PM
samjudson's Avatar
Friend of Wrox
Points: 8,687, Level: 40
Points: 8,687, Level: 40 Points: 8,687, Level: 40 Points: 8,687, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Basically I think you'll have to write some SQL that returns what you want, or alternatively create dictionary manually from the SQL yourself. I don't believe there is anything in the DataGridView which is going to allow you to do this easily.

/- Sam Judson : Wrox Technical Editor -/
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
datagridview help manius VB Databases Basics 1 January 27th, 2008 02:44 AM
DataGridView Loop + Compare obrienkev C# 2005 1 December 30th, 2007 07:53 PM
DataGridView Use BrianWren Visual Basic 2005 Basics 1 March 5th, 2007 04:34 PM
DataGridView Sakkaw C# 2005 1 January 9th, 2007 12:06 PM
nested while loop doesn't loop hosefo81 PHP Databases 5 November 12th, 2003 08:46 AM



All times are GMT -4. The time now is 12:12 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.