MYSQL源,需求,按窗口的起止日期将表A和表B的合并后加载。
执行下面的代码,没有报错,也没有反应?
Dim StartDate As Date = New Date(Date.today.Year, Date.today.Month, 1)
Dim EndDate As Date = New Date(Date.today.Year, Date.today.Month, Date.DaysInMonth(Date.today.Year, Date.today.Month))
Dim db = HySq-l.DataBaseFactory.CreateDatabase("my") '
Dim Sq-l2 = "Selec-t a.单号,a.产品编号, a.品名, a.规格型号, a.单位, a.数量,b.供方, b.日期 From 表A as a Inner Join 表B as b On (a.单号 = b.单号) " & _
"where b.日期 >= '" & StartDate & "' And b.日期 <= '" & EndDate & "' "
Dim dt2 As system.data.DataTable = db.ExecuteDataSet(Sq-l2).Tables(0)
Dim t2 As Table = e.Form.Controls("Table1").Table
t2.datasource = dt2.Copy
t2.AllowEdit = False
[此贴子已经被作者于2023/12/11 16:03:21编辑过]