Foxtable(狐表)用户栏目专家坐堂 → 列出外部数据源中所有表名


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

主题:列出外部数据源中所有表名

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


加好友 发短信
等级:童狐 帖子:257 积分:2960 威望:0 精华:0 注册:2020/5/21 17:56:00
列出外部数据源中所有表名  发帖心情 Post By:2022/6/30 0:38:00 [只看该作者]

Dim lst As List(Of String)
lst = Connections("数据源名").GetTableNames
For Each nm As String In lst
    Dim dd1 As WinForm.ComboBox = e.Form.Controls("ComboBox1")
    dd1.ComboList = lst
Next
这么写ComboBox只能列出最后一个数据表名!求助

[此贴子已经被作者于2022/6/30 0:38:33编辑过]

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


加好友 发短信
等级:超级版主 帖子:106732 积分:542855 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2022/6/30 9:07:00 [只看该作者]

方法1、
Dim lst As List(Of String)
lst = Connections("数据源名").GetTableNames
    Dim dd1 As WinForm.ComboBox = e.Form.Controls("ComboBox1")
For Each nm As String In lst
    dd1.items.add(nm)
Next

2、
Dim lst As List(Of String)
lst = Connections("数据源名").GetTableNames
    Dim dd1 As WinForm.ComboBox = e.Form.Controls("ComboBox1")
    dd1.ComboList = string.join("|",lst.toarray)

 回到顶部