以不同的方式从网格中重新获取数据请帮助我 [英] Retriving data from grid in a different manner pls help me

查看:79
本文介绍了以不同的方式从网格中重新获取数据请帮助我的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Sql数据库,asp.net(c#)



我有两张桌子



1 Session1



ItemName数量价格日期

...................... ............

洋葱22 30 12/06/2012

盐2 15 12/06/2012

egg 13 43 12/06/2012

chilly 12 88 12/06/2012

maida 6 77 13/06/2012

油7 227 12/06/2012

nuts 1 300 13/06/2012





2产品



产品数量价格日期

...................... .....................

Puffs 22 120 12/06/2012

porotta 35 350 13 / 06/2012



我想以不同的方式将这些数据检索到我的datagridview,如下所示



ITEMNAME QUANTTITY PRICE DATE产品数量价格日期

................................... ...........................................

洋葱22 30 12/06/2012 Puffs 22 120 12/06/2012

salt 2 15 12/06/2012

egg 13 43 12/06/2012 < br $> b $ b寒冷12 88 12/06/2012

oil 7 227 12/06/2012

........... .................................................. ..................

maida 6 77 13/06/2012 porotta 35 350 13/06/2012

坚果1 300 13/06/2012

Sql database ,asp.net(c#)

I have two table

1 Session1

ItemName Quantity Price Date
..................................
Onion 22 30 12/06/2012
salt 2 15 12/06/2012
egg 13 43 12/06/2012
chilly 12 88 12/06/2012
maida 6 77 13/06/2012
oil 7 227 12/06/2012
nuts 1 300 13/06/2012


2 Product

Product Quantity Price Date
...........................................
Puffs 22 120 12/06/2012
porotta 35 350 13/06/2012

I want to retrieve this data to my datagridview like in a different manner just see below

ITEMNAME QUANTITY PRICE DATE PRODUCT QUANTITY PRICE DATE
..............................................................................
Onion 22 30 12/06/2012 Puffs 22 120 12/06/2012
salt 2 15 12/06/2012
egg 13 43 12/06/2012
chilly 12 88 12/06/2012
oil 7 227 12/06/2012
...............................................................................
maida 6 77 13/06/2012 porotta 35 350 13/06/2012
nuts 1 300 13/06/2012

推荐答案

我看到你在使用ASP.Net?你能不能使用样式表将标题设置为大写字母?

你的样式表中有这样的东西:



table thead th {br />
text-transform:大写;

}



一个漂亮的表设计师:http://tablestyler.com/ [ ^ ]
I see you are using ASP.Net? Can you not set the headings to caps using a style sheet?
Something like this in your stylesheet:

table thead th {
text-transform: uppercase;
}

A nice table designer here: http://tablestyler.com/[^]


首先转换数据表到列表,然后在此列表上执行选择查询......

然后将此列表绑定到GridView < br $> b $ b

http ://stackoverflow.com/questions/441023/fastest-way-to-convert-datatable-to-generic-list [ ^ ]

http://forums.asp.net/ t / 1720459.aspx / 1 [ ^ ]

http:/ /www.devcurry.com/2010/01/convert-datatable-to-list-using-c-or.html [ ^ ]
First Convert Your Datatable To list and Then Perform Select Query On This List......
then bind this list to your GridView

http://stackoverflow.com/questions/441023/fastest-way-to-convert-datatable-to-generic-list[^]
http://forums.asp.net/t/1720459.aspx/1[^]
http://www.devcurry.com/2010/01/convert-datatable-to-list-using-c-or.html[^]


这篇关于以不同的方式从网格中重新获取数据请帮助我的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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