楼主:因没有实例文件,现只能随手写了一下,大概是这样子吧
Dim qsrq As Date =e.Form.Controls("DateTimePicker32").Value
Dim jsrq As Date =e.Form.Controls("DateTimePicker33").Value
If e.Form.Controls("DateTimePicker32").Value IsNot Nothing And e.Form.Controls("DateTimePicker33").Value IsNot Nothing
Dim i As new SQLCommand
Dim dt As DataTable
i.C
i.CommandText ="Select * from {成品输入} where 日期 >=#" & qsrq & "# and 日期 <= #" & jsrq & "#"
dt =i.ExecuteReader
Dim f As New Filler
f.SourceTable = dt '指定数据来源
f.SourceCols = "品号,颜色,匹数,拼包段长,结辨_A,结辨_A1" '指定数据来源列
f.DataTable = DataTables("成品结辨") '指定数据接收表
f.DataCols = "品号,颜色,匹数,拼包段长,结辨原因,结辨个数" '指定数据接收列
f.Fill() '填充数据
End If