I have a combobox bound to a stored procedure, which writes the Selected Value to a table in my database. Works great! Now I want to populate another combobox based on the selection in the first combobox. In order to do so, it will have to filter based off a sub_category_id related to the Selected Value in my first combobox. I have the logic worked out in SQL, just need help making it work in VB.Net. I do not really want to code in a pass through query. I would rather somehow pass the sub_category_id to a stored procedure as its paramenter. Any ideas on how I can make this work?
Example Table:
SELECT LOOKUP_CATEGORY, VALUE, LABEL
FROM REPAIR_LOOKUP
WHERE LOOKUP_CATEGORY = (SELECT SUB_CATEGORY_ID
FROM REPAIR_LOOKUP
WHERE VALUE = ComboBox1.SelectedValue)
AND ACTIVE = 'Y'
ORDER BY LABEL ASC
Example Table:
CATEGORY ID | SUB CATEGORY ID | VALUE | LABEL |
PCAT | CENF | CENTRIFUGAL_FAN | Centrifugal Fan |
COND | CONDENSER | Condenser |
SELECT LOOKUP_CATEGORY, VALUE, LABEL
FROM REPAIR_LOOKUP
WHERE LOOKUP_CATEGORY = (SELECT SUB_CATEGORY_ID
FROM REPAIR_LOOKUP
WHERE VALUE = ComboBox1.SelectedValue)
AND ACTIVE = 'Y'
ORDER BY LABEL ASC