Click here to Skip to main content
11,648,785 members (78,629 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET VB.NET
i have table in database in which values are stored a

id cat test val
1. micoexpansion albumin 40
2. microexpanison sugar 20
3. microexpansion jhhj 30
4. macroexpnsion glucose 01
5. macroexpansion hjkh 50

when i am displaying this data in gridview

after formatting i get like this


microexpansion
albumin 40
microexpansion
sugar 20
microexpansion
jhhj 30
macroexpnsion
glucose 01
macroexpansion
hjkh 50


but i want to show like this

Microexpansion
albumin 40
sugar 20
jhhj 30

macroexpnsion
glucose 01
hjkh 50


how can i perform this..

Thanks in Advance.
Posted 26-Feb-13 23:44pm
Comments
Tejas Vaishnav at 27-Feb-13 5:49am
   
what was your select query you are firing on database to select data from database?
Jasbeer Singh at 27-Feb-13 5:54am
   
SELECT DISTINCT username, examination, tests,val FROM [report] WHERE ([username] = @username)"
Strange_Pirate at 18-Mar-13 8:27am
   
Which query you are firing to select data from respective TABLE. .

There is correction in your reply

:D

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Dear Friend,

You can simply print data directly on screen.

For generate displaying format according to your choise.

You can simply use newline syntax, "System.out.println" and "\t" as well.

For this purpose first you have recieved your Result set after manipulation into result set according to your choice Format.

Whenever you complete format simply print data.

Be remember always you done this format on after get data from database, there is not possible for saving data inside database as GRID Format.

Best Regards,
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 CPallini 370
1 F-ES Sitecore 364
2 OriginalGriff 324
3 Kornfeld Eliyahu Peter 324
4 Sergey Alexandrovich Kryukov 254
0 OriginalGriff 1,512
1 Sergey Alexandrovich Kryukov 1,022
2 jyo.net 994
3 DamithSL 986
4 CPallini 945


Advertise | Privacy | Mobile
Web01 | 2.8.150804.4 | Last Updated 27 Feb 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100