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 maincategory 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..