DataTables("HZXHLTJB").DeleteFor("")
Dim cmd As new SQLCommand
cmd.CommandText = "select distinct hzxm from (Select qjhzxm As hzxm from {GMYS} union all Select XJHZXM As hzxm from {GMYX}) as a"
Dim dt As DataTable = cmd.ExecuteReader()
Dim ndr As DataRow
DataTables("HZXHLTJB").StopRedraw
For Each dr As DataRow In dt.DataRows
ndr = DataTables("HZXHLTJB").AddNew
ndr("HZXM") = dr("hzxm")
Next
DataTables("HZXHLTJB").ResumeRedraw
如果要加条件
Dim xz As String = "道让"
cmd.CommandText = "select distinct hzxm from (Select qjhzxm As hzxm from {GMYS} where SJXZMC='" & xz & "' union all Select XJHZXM As hzxm from {GMYX} where SJXZMC='" & xz & "') As a"