Q:

sqldatasource and dropdown list

I have 2 DropDownLists, the first one has a SqlDataSource with only one field, and another DropDownList has a SqlDataSource with a where clause baseed on the selection of the first drop down.  
If I press a button the second drop down list populate with the query but how can I make it to populate after selecting an item from the first one. 

A:

you can handle the SelectionChangeCommitted event of first combo box.  And then after building the datasource you can assign it to your second combobox.  Like below
private void comboBox1_SelectionChangeCommitted(object sender, EventArgs e)
{
    //build your datasource with the query
    comboBox2.DataSource = datasource;
}

