I have a combo box of part numbers on a form and I want to pass the selected value of the item to a query to build a radgridview. In ASP.NET this was easy as you just passed in the paramaters. How would I go about this in WinForms?
Below is the Query that runs and I pass in Part Number and Facility and in ASP.NET it works wonderful. Would I need to setup an OleDbConnection connection? Like in http://www.telerik.com/help/winforms/grid_binding-to-datareader.html this example? How do I pass in the paramaters each time a new PN is selected from the ComboBox.
Below is the Query that runs and I pass in Part Number and Facility and in ASP.NET it works wonderful. Would I need to setup an OleDbConnection connection? Like in http://www.telerik.com/help/winforms/grid_binding-to-datareader.html this example? How do I pass in the paramaters each time a new PN is selected from the ComboBox.
WITH BOMCTE |
AS |
( |
SELECT * |
FROM MBM |
WHERE BPROD = @PN |
UNION ALL |
SELECT MBM.* |
FROM MBM |
JOIN BOMCTE |
ON MBM.BPROD = BOMCTE.BCHLD and MBM.BMBOMM = BOMCTE.BMBOMM |
) |
SELECT DISTINCT cast(BCHLD as varchar(100))as ChildID, cast(BPROD as varchar(100))as ParentID, BSEQ as Sequence, IABC as 'ABC Code', ICOND as 'Condition Code', IDESC, IDSCE as '2nd Desc', ICITYP as Type, ICLAS as Team FROM BOMCTE |
INNER JOIN IIM on BCHLD = IPROD |
INNER JOIN CIC on BCHLD = ICPROD |
UNION ALL |
SELECT DISTINCT cast(ICPROD as varchar(100))as ChildID, cast(NULL as varchar(100))as ParentID, 0 as Sequence, IABC as 'ABC Code', ICOND as 'Condition Code', IDESC, IDSCE as '2nd Desc', ICITYP as Type, ICLAS as Team |
FROM CIC |
INNER JOIN IIM on ICPROD = IPROD |
WHERE ICFAC = @FAC and ICPROD = @PN Order by Sequence |