我有2个表1Tbl_purchasemaster1和1Tbl_purchasesub1以及类似的查询:
SELECT Tbl_PurchaseMaster.dtPurchaseDate,Tbl_PurchaseMaster.vaSupplierName,
Tbl_PurchaseSub.vaItemCode,Tbl_PurchaseSub.intQuantity
FROM Tbl_PurchaseMaster
INNER JOIN Tbl_PurchaseSub
ON
dbo.Tbl_PurchaseMaster.intPurchaseMasterID = dbo.Tbl_PurchaseSub.intPurchaseMasterID
where dtPurchaseDate between '" + dtfr + "'and'" + dtto
+ "' dtfr=datefrom and dtto=dateto..
如何将这些值填入数据集?填写后,我想在Crystal Reports中显示它。请帮忙
答案 0 :(得分:0)
如果你已经完成了连接,SQL会有效地返回一个表,你可以把它作为DataTable放到DataSet中。
您还可以将每个表分别查询到DataSet中的两个DataTable,然后添加关系。
DataSet中没有规定可以获取SQL连接的结果并将其拆分为多个DataTable。