Wrox Programmer Forums
|
BOOK: Beginning Visual C# 2010
This is the forum to discuss the Wrox book Beginning Visual C# 2010 by Karli Watson, Christian Nagel, Jacob Hammer Pedersen, Jon D. Reid, Morgan Skinner, ; ISBN: 9780470502266
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Visual C# 2010 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 13th, 2011, 05:18 PM
Registered User
 
Join Date: Nov 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default QueriesTableAdapter

Visual Studion 2010, C Sharp

I have created a dataset 'FPdbDataset' with four tables and a QueriesTableAdapter 'wklysalesTableAdapter' which has the following SQL statement:

SELECT SUM(TransactionEntry.Quantity) AS Sold, DATEPART(WEEK, [Transaction].Time) AS WkNo,
TransactionEntry.ItemID AS ItmId, Item.Description AS Title,
Item.ItemLookupCode AS Code, Item.Quantity AS Stock
FROM TransactionEntry INNER JOIN
[Transaction] ON TransactionEntry.TransactionNumber = [Transaction].TransactionNumber INNER
JOIN
Item ON TransactionEntry.ItemID = Item.ID
WHERE (Item.DateCreated >= @Param1) AND (Item.DepartmentID = @Param2)
GROUP BY DATEPART(WEEK, [Transaction].Time), TransactionEntry.ItemID, Item.Description, Item.ItemLookupCode, Item.Quantity
ORDER BY ItmId, WkNo

The purpose of the select statement (which works fine), is to display the number of items sold per week based on their department. I have a Windows form with two grids: grid1 to display the departments and grid2 for the wklysales query. Grid1 works fine but I cannot find a way to fill grid2 with the results of the wklysales query based on the department selected in grid1 (via @Param2).

I'm a total newbie to this and would be extremely greateful for any assistance.

Rich









Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.