第三方数据库不能使用内置的Load加载数据的,只能像第一段代码一样绑定表控件,生成的条件必须符合m
ysql的语法
……
Case 2
Filter = "Year(采购日期) = " & Year & " And Month(采购日期) = " & Month & " And 供方 = '" & Product & "'"
End Select
Dim db = HySq-l.DataBaseFactory.CreateDatabase("myjx") '
Dim Sq-l2 = "Selec-t a.采购单号,a.产品编号, a.品名, a.交货日期,b.供方, b.采购日期, b.供方,b.制单人,b.UserID From cgm_tb as a Inner Join cgz_tb as b On (a.采购单号 = b.采购单号) " & _
"where (b.制单人= '" & _Username & "' or b.UserID in ('" & s.Replace(",", "','") & "')) and " & Filter
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 '