Populate 2nd combobox based on the 1st combobox
i want to update my second combo box based on the choice on the first
combobox. what is the simplest way to do this? i had my first combobox works.
ok.. so far, this is my code for the 1st combobox
using (SqlConnection conn = new SqlConnection(Properties.Settings.Default.dbConnectionString))
{
SqlDataAdapter da = new SqlDataAdapter("SELECT [CategoryName] FROM Categories",conn);
DataSet ds = new DataSet();
daCat.Fill(ds,"Categories");
comboBox1.DataSource = ds.Tables["Categories"];
comboBox1.DisplayMember = "CategoryName";
}
i don't know how the code for second combobox will start. but the sql will say something like this..
select productname
from products
where categoryID=combobox1.text

savan gandhi45 reputationPosted Apr 3, 2007, 4:54 AM EDT
waffle43 reputationPosted Apr 3, 2007, 6:38 AM EDT
savan gandhi45 reputationPosted Apr 3, 2007, 6:59 AM EDT
waffle43 reputationPosted Apr 3, 2007, 7:12 AM EDT
waffle43 reputationPosted Apr 3, 2007, 11:40 PM EDT
savan gandhi45 reputationPosted Apr 4, 2007, 6:21 AM EDT
waffle43 reputationPosted Apr 4, 2007, 7:34 AM EDT
savan gandhi45 reputationPosted Apr 6, 2007, 8:13 AM EDT
waffle43 reputationPosted Apr 7, 2007, 8:34 PM EDT