Dim cmd As New SQLCommand
Dim dt As DataTable
cmd.C
cmd.CommandText = "Select * From {MA14_MRP_Detail} where ([SNo] Not IN(Select [MRPSNo] From {PU02_Order_Detail})) And ([BillNo] In(Select [BillNo] From {MA14_MRP} where [State] = 2)) And [Qty] > 0 And [PurchaseOrProduce] = '采购'"
dt = cmd.ExecuteReader
dt.DataCols.Add("备注",Gettype(String)) '窗口名是 SQLTest
Tables("SQLTest_Table1").DataSource = dt
然后是