在griview中显示数据 [英] showing data in griview

查看:75
本文介绍了在griview中显示数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在数据库中有值存储的表格



id cat test val

1. micoexpansion albumin 40
2. microexpanison sugar 20

3. microexpansion jhhj 30

4. macroexpnsion葡萄糖01

5. macroexpansion hjkh 50



我在gridview中显示这些数据



格式化之后我得到这样的





microexpansion

白蛋白40

microexpansion

糖20

microexpansion

jhhj 30

macroexpnsion

葡萄糖01

macroexpansion

hjkh 50





但是我想这样展示



Microexpansion

白蛋白40

糖20

jhhj 30



macroexpnsion

葡萄糖01

hjkh 50





我怎么能这样做..



比ks in Advance。

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.

推荐答案

亲爱的朋友,



您可以直接在屏幕上打印数据。 br />


根据你的选择生成显示格式。



你可以简单地使用换行语法,系统。 out.println和\t以及。



为此,首先根据您选择的格式在操作结果集后收到结果集。



每当你完成格式化时只需打印数据。



记住你总是在完成这个格式之后来自数据库的数据,无法将数据库中的数据保存为GRID格式。



最好的问候,
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,


这篇关于在griview中显示数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆