HighTechTalks DotNet Forums  

Formatting result from a database query

ASP.net Data Grid Control microsoft.public.dotnet.framework.aspnet.datagridcontrol


Discuss Formatting result from a database query in the ASP.net Data Grid Control forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Mathias
 
Posts: n/a

Default Formatting result from a database query - 11-21-2006 , 01:40 PM






From my database query I get the following:

Text Number
Albert 12
Albert 14
Albert 16
Brian 20
Brian 21
Brian 22

Now I'd like to represent the data as:

Albert 12 14 16
Brian 20 21 22

I've looked at repeaters, data sets, data readers but I can't figure
out how to go about it. Preferably I'd like to represent the data in a
GridView. Can anyone please guide me in the right direction?


Reply With Quote
  #2  
Old   
Eliyahu Goldin
 
Posts: n/a

Default Re: Formatting result from a database query - 11-22-2006 , 09:44 AM






The easiest solution is to build programmatically a new datatable containing
one row per name out of the original result set and databind the gridview to
the new table.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]


"Mathias" <nej (AT) tak (DOT) du> wrote

Quote:
From my database query I get the following:

Text Number
Albert 12
Albert 14
Albert 16
Brian 20
Brian 21
Brian 22

Now I'd like to represent the data as:

Albert 12 14 16
Brian 20 21 22

I've looked at repeaters, data sets, data readers but I can't figure
out how to go about it. Preferably I'd like to represent the data in a
GridView. Can anyone please guide me in the right direction?




Reply With Quote
Reply




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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.