I have 3 comboBox..
And I wanted a code for the thirdcombobox , something like
SELECT companyName FROM table where mainCategory = firstcombobox and subcategory = secondcombobox , how do I do the SQL query?
My main category combobox is called mainCatU , and the subcategory is subCatU
I managed to make subCatU's value based on mainCatU , now I wanted a third combobox value determined by both the value of the maincategory and subcategory.
It is either just an SQL Query or other thing?
Can anyone help?
I have tried following some other codes such as
string strQuery = "SELECT * FROM Purchase where ItemID=(SELECT ItemID FROM ItemMaster where ItemName='" + DropDownList3.SelectedItem.Text + '" and CategoryID=(SELECT CategoryID FROM ItemMaster where ItemName='"+ DropDownList3.SelectedItem.Text + '")";
But I do not use that.. Since I am using it like this..
SqlDataAdapter daSearch = new SqlDataAdapter("SELECT companyName FROM CompanyDetail", conn);
Help please..