VB 2005 的ComboBox

xiaoyao_duan 2008-11-18 06:09:27
vb 2005 中实现 从一个表中查找一列字段(不重复的)将查找到的数据添加到ComboBox中
...全文
106 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
xiaoyao_duan 2008-11-19
  • 打赏
  • 举报
回复
谢谢了,OK 了!!!
一只熊猫 2008-11-19
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 lugang386 的回复:]
引用 2 楼 duzhonghua 的回复:
引用 1 楼 floadcloud 的回复:
方法一
dim myDs new DataSet
通过SQL返回dataset

select distinct column1 from table
.....
combobox1.DataSource = myDs.Table(0).DefaultView()
combobox1.DisplyMember = "column1"
combobox1.ValueMember = "column1"

方法二
for I as integer to myDs.table(0).rows.count-1
combobox1.items.add(myDs.table(0).rows(I)("column1"))
next


[/Quote]

真的是正解
lugang386 2008-11-19
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 duzhonghua 的回复:]
引用 1 楼 floadcloud 的回复:
方法一
dim myDs new DataSet
通过SQL返回dataset

select distinct column1 from table
.....
combobox1.DataSource = myDs.Table(0).DefaultView()
combobox1.DisplyMember = "column1"
combobox1.ValueMember = "column1"

方法二
for I as integer to myDs.table(0).rows.count-1
combobox1.items.add(myDs.table(0).rows(I)("column1"))
next

楼上正解....…
[/Quote]
楼上正解....…
duzhonghua 2008-11-19
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 floadcloud 的回复:]
方法一
dim myDs new DataSet
通过SQL返回dataset

select distinct column1 from table
.....
combobox1.DataSource = myDs.Table(0).DefaultView()
combobox1.DisplyMember = "column1"
combobox1.ValueMember = "column1"

方法二
for I as integer to myDs.table(0).rows.count-1
combobox1.items.add(myDs.table(0).rows(I)("column1"))
next
[/Quote]
楼上正解........
floadcloud 2008-11-18
  • 打赏
  • 举报
回复
方法一
dim myDs new DataSet
通过SQL返回dataset

select distinct column1 from table
.....
combobox1.DataSource = myDs.Table(0).DefaultView()
combobox1.DisplyMember = "column1"
combobox1.ValueMember = "column1"

方法二
for I as integer to myDs.table(0).rows.count-1
combobox1.items.add(myDs.table(0).rows(I)("column1"))
next

16,717

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧