如何将数据库表的多个列名绑定到下拉列表? [英] How to bind database table multiple column names to the dropdownlist?

查看:63
本文介绍了如何将数据库表的多个列名绑定到下拉列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hai Sir,

我的数据库中有一个表Subject,列名为subid,sub1,sub2,sub3等。

我想绑定这些列名称在我的前端(.NET)的下拉列表中。

Hai Sir,
I have one table "Subject" in my database with column names subid,sub1,sub2,sub3 and etc.
And I want to bind these column names to the dropdown list in my frontend(.NET).

推荐答案

如果我得到了这些,那么它们应该指向正确的方向你在问什么:



使用ASP.NET中的列表集合,枚举和数据集绑定DropDownList [ ^ ]



使用c#将数据绑定到下拉列表 [ ^ ]


了解DataValueField和DataTextField。
Have a read of these, they should point you in the correct direction, if I get what you are asking:

Binding DropDownList Using List Collection, Enum and DataSet in ASP.NET[^]

bind data to dropdownlist with c#[^]

Read up about DataValueField and DataTextField .


这篇关于如何将数据库表的多个列名绑定到下拉列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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