从数据库中检索数据并以字符串形式存储,并将所有字符串绑定到gridview [英] Retrieve data from database and store in string and bind all the strings to gridview

查看:82
本文介绍了从数据库中检索数据并以字符串形式存储,并将所有字符串绑定到gridview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用存储过程将数据从数据库提取到gridview中。我不想在gridview中将列名指定为boundfield的datafeild属性。我想在后面的代码中将所有列提取为单独的字符串,并在数据字段中指定字符串名称。





提前感谢

i am extracting data from database into gridview with stored procedures. i dont want to specify the column names into datafeild attribute of boundfield in gridview. i want to extract all the columns into seperate strings in code behind and specify string name in datafield.


thanks in advance

推荐答案

Quote:

我不想将列名指定为boundfield的datafeild属性gridview。

i dont want to specify the column names into datafeild attribute of boundfield in gridview.



您可以使用如下所示的选择查询:


You can use select query like below:

Select name As Name......




Select ac_num as Account Number....



在这种情况下,你可以简单地绑定gridview,它最终会有你指定的列名。



问候..:)


In this case,you can simply bind gridview which will ultimately have a column names you specified.

Regards..:)


我在列表中存储了1列< string>和数据集中的所有其他列..如何将它们绑定到同一gridview
i have 1 column stored in list<string> and all other columns in dataset.. how can i bind them both to the same gridview


这篇关于从数据库中检索数据并以字符串形式存储,并将所有字符串绑定到gridview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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