显示很成的语句:
Dim cmd As New SQLCommand
Dim dt As DataTable
Dim cmb As WinForm.ComboBox
cmd.C
cmd.CommandText = "SELECT DISTINCT mingcheng From {jigou} where (mingcheng = '" & _UserGroup & "' Or jicheng Like '%" & _UserGroup & "%') And zhuangtai = 1 "
messageagebox.show(cmd.CommandText)
dt = cmd.ExecuteReader()
cmb = e.Form.Controls("ComboBox1")
cmb.ComboList = dt.GetComboListString("mingcheng")
复制生成的语句:
粘贴到SQL执行窗口测试分析:
[此贴子已经被作者于2014-4-26 10:01:57编辑过]