以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  列出外部数据源中所有表名  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=178326)

--  作者:237756360
--  发布时间: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编辑过]

--  作者:有点蓝
--  发布时间: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)