0
我有2個表1Tbl_purchasemaster1和1Tbl_purchasesub1和類似的查詢:我如何可以填補數據集與一個內從2個表中的值加入查詢
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中顯示它。請幫助
真的非常感謝您的回答。我已經加入了2張表格Tbl_Purchasemaster和Tbl_Purchasesub.which表格有效地返回了嗎?您能解釋一下上面提到的第二種方法嗎? –
當我有效地說一張表時,我的意思是它返回一組帶有字段的行。以下是如何填充DataTable並創建DataRelation的示例:http://csharp.net-informations.com/dataset/dataset-relations.htm –