以文本方式查看主题

-  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=107204)

--  作者:积水成渊
--  发布时间:2017/9/23 10:49:00
--  [讨论]列表项目
我用SQL语句查询一个字段的内容,然后这些内容作为我表中某个列的列表项目,求代码该怎么写
--  作者:积水成渊
--  发布时间:2017/9/23 11:05:00
--  
我写了这段代码,怎么改才行


Dim cmd As New SQLCommand
Dim dt As DataTable
cmd.C
Dim cmb As DataCol = dt.DataCol("类别编码")
cmd.CommandText = " s elect 类别编码 from HR_人事类别定义 w here 类别组 = \'02\'"
dt = cmd.ExecuteReader()
cmb.ComboList= dt.GetComboListString("类别编码")
output.show(cmb.ComboList)

--  作者:有点蓝
--  发布时间:2017/9/23 11:18:00
--  
Dim cmb As DataCol = DataTables("xxx表").DataCol("类别编码")
--  作者:积水成渊
--  发布时间:2017/9/23 11:34:00
--  
感谢,采用另外的方法解决了:
If e.IsFocusCell Then \'如果是焦点单元格
    If e.Col.Name = "类别编码" Then \'如果正在编辑的是类别编码列
        e.Col.Combolist = DataTables("HR_人事类别定义").SQLGetComboListString("类别编码", "[类别组] = \'" & e.Row("组编码") & "\'") 
    End If
End If