Foxtable(狐表)用户栏目专家坐堂 → [求助]组合框初始值(已解决)


  共有12498人关注过本帖树形打印复制链接

主题:[求助]组合框初始值(已解决)

帅哥哟,离线,有人找我吗?
ybil
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:521 积分:4910 威望:0 精华:7 注册:2008/9/2 22:22:00
  发帖心情 Post By:2011/7/1 9:57:00 [显示全部帖子]

Dim cmd As New SQLCommand
Dim dt As DataTable
Dim cmb As WinForm.ComboBox
cmd.CommandText = "SELECT TOP 4 * FROM (SELECT DISTINCT 第一列 From {表A} ORDER BY 第一列 DESC)"
dt = cmd.ExecuteReader()
cmb = e.Form.Controls("ComboBox1")
cmb.ComboList= dt.GetComboListString("第一列","","第一列 Desc")
cmb.Value = dt.DataRows(0)("第一列")

 回到顶部
帅哥哟,离线,有人找我吗?
ybil
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:521 积分:4910 威望:0 精华:7 注册:2008/9/2 22:22:00
  发帖心情 Post By:2011/7/1 13:20:00 [显示全部帖子]

Dim cmd As New SQLCommand
Dim dt As DataTable
Dim cmb As WinForm.ComboBox
cmd.CommandText = "SELECT DISTINCT Left(第一列,4) As 第一列 From {表A}"
dt = cmd.ExecuteReader()
cmb = e.Form.Controls("ComboBox1")
cmb.ComboList= dt.GetComboListString("第一列","","第一列 Desc")
cmb.Value = cmb.ComboList.split("|")(0)
[此贴子已经被作者于2011-7-1 13:52:04编辑过]

 回到顶部