以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]从后台生成复选列表框的值?  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=29467)

--  作者:红颜
--  发布时间:2013/3/7 11:45:00
--  [求助]从后台生成复选列表框的值?

Dim chk As WinForm.CheckedListBox = e.form.Controls("CheckedListBox1")
Dim Arys As List(Of String())
Arys = DataTables("SFMX").GetUniqueValues("编号","客户","品名")
For Each Ary As String() In Arys   
    chk.items.Add(ary(0) & "," & ary(1) & "," & ary(2))
Next
End If

 

上面代码只能从前台生成列项目,从后台如何写,用什么方法更好?

 

如用SQLCommand,如何同时显示("编号","客户","品名")

 

 

[此贴子已经被作者于2013-3-7 11:47:40编辑过]

--  作者:狐狸爸爸
--  发布时间:2013/3/7 13:56:00
--  

可以看看:
http://www.foxtable.com/help/topics/1995.htm

http://www.foxtable.com/help/topics/0688.htm

http://www.foxtable.com/help/topics/0696.htm
 
Dim chk As WinForm.CheckedListBox = e.form.Controls("CheckedListBox1")
Dim cmd As New SQLCommand
cmd.CommandText = "SELECT DISTINCT 编号,客户,品名 From {订单}"
dt = cmd.ExecuteReader()
For each dr as datarow in dt.datarows
   chk.items.Add(dr("编号") & "," & dr("客户") & "," & dr("品名"))
next