'Tables("线条计划_Table1").Fill("SELECT * FROM [mjcomtxmxhz]","ssmjmm",True)
Dim cmd As New SQLCommand
Dim dt As DataTable
Dim Cols1() As String = {"dh","hh","sl"}
Dim Cols2() As String = {"dh","hh","sl"}
cmd.ConnectionName="test"
cmd.CommandText = "SELECT dh,hh,sl From {mjcomtxmxhz} where gx='配线' and dh<>'' and hh <>'' AND dh+hh not in(SELECT [dh]+[hh] FROM [zzmjcomtxmxhz])"
dt = cmd.ExecuteReader()
Tables("zzmjcomtxmxzb.zzmjcomtxmxhz").StopRedraw
For Each dr1 As DataRow In dt.DataRows
Dim dr2 As DataRow = Tables("zzmjcomtxmxzb.zzmjcomtxmxhz").DataTable.AddNew()
For i As Integer = 0 To Cols1.Length -1
dr2(Cols2(i)) = dr1(Cols1(i))
Next
dr2("单号") = Tables("zzmjcomtxmxzb").current("单号")
Next
Tables("zzmjcomtxmxzb.zzmjcomtxmxhz").ResumeRedraw
'dt.save