Click here to Skip to main content
15,886,740 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Comments
Tejas Vaishnav 27-Feb-13 5:49am    
what was your select query you are firing on database to select data from database?
Jasbeer Singh 27-Feb-13 5:54am    
SELECT DISTINCT username, examination, tests,val FROM [report] WHERE ([username] = @username)"
Strange_Pirate 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

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,
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900