a. you initialize the first ComboBox from the results of a database query.
a.1. set the 'DataSource of the ComboBox to the query result (transforming the query result into a set of 'objects as required),
a.2. then set the 'ValueMember and 'DisplayMember properties of the ComboBox as needed.
a.3. implement a 'SelectionIndexChanged EventHandler for the ComboBox
b. based on the user's actions ... making a selection in the first ComboBox ...
b.1. you make another query to the database to retrieve the appropriate values for the second ComboBox, and you set its values using the techniques mentioned in a.1.
b.2. implement an event handler as in a.3.
A lot depends here on what the structure of your database is (many tables ?), and whether the database contents (rows, fields) are small enough that you can do one (or a series of) query and get all the data you'll need in the UI, and then create a Collection to hold the sets of values for the second ComboBox ... rather than having to load the second ComboBox values every time there is a selection in the first ComboBox.
A rough sketch:
private int currentSelectedIndex1 = 0;
private int currentSelectedIndex2 = 0;
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
if (comboBox1.SelectedIndex < 0) return;
currentSelectedIndex1 = comboBox1.SelectedIndex;
}
private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
{
if (comboBox2.SelectedIndex < 0) return;
currentSelectedIndex2 = comboBox2.SelectedIndex;
}