您的位置:程序门 -> .net技术 -> c#



combobox的绑定问题


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


combobox的绑定问题
发表于:2007-02-08 19:20:05 楼主
我是这样绑定的
combobox1.datasource   =   ds
combobox1.displaymember   =   "cname ";
combobox1.valuemember   =   "other ";

我是想在修改那里从数据库读出二个值(text和value)

让combobox里显示的是我读出来的值????
发表于:2007-02-08 19:28:441楼 得分:0
select   text+value   as   tv   from   tablename     combobox1.displaymember   =   "cname ";
发表于:2007-02-09 08:10:042楼 得分:0
up
发表于:2007-02-09 08:57:323楼 得分:0
?
发表于:2007-02-09 09:45:464楼 得分:0
看不懂你说什么,你的代码不是正好吗?
发表于:2007-02-09 09:51:115楼 得分:0
我的意思是假如那帮定的数据有
a1
a2
a3
a4
a5

现在想让a5被选定(a5是不定的,也就是说a5是从别的地方读出来的)
发表于:2007-02-09 10:33:526楼 得分:0
?
发表于:2007-02-09 10:54:187楼 得分:0
真没有人能解了吗???
发表于:2007-02-09 11:14:468楼 得分:0
this.datasource   =   m_dataset.tables[0];
this.displaymember   =   "danweimingcheng ";   显示的值
this.valuemember   =   "danweidaima ";               实际值


快速检索

最新资讯
热门点击