You have the two drop downs and already you binded with them.
Create the ListBox in ASP.Net and now you want to bind the third table based on the two dropdown selection.
<asp:ListBox ID="lstBackupfiles" runat="server" Height="236px" Width="354px"></asp:ListBox>
END
Execute it in your sql server query window.
Write the code in the code file:
SqlConnection sqlConnection = new SqlConnection();
sqlConnection.ConnectionString = @"Data Source=SQLEXPRESS;Initial Catalog=Master;Integrated Security=true;";
sqlConnection.Open();
SqlCommand sqlCommand = new SqlCommand();
sqlCommand.CommandType = CommandType.StoredProcedure;
sqlCommand.Connection = sqlConnection;
sqlCommand.CommandText = "Proc_FillListBox";
sqlCommand.Parameters.Add("@ddl1ID", SqlDbType.Int).Value = Convert.ToInt32(ddl1.SelectedItem.Value.ToString());
sqlCommand.Parameters.Add("@ddl2ID", SqlDbType.Int).Value = Convert.ToInt32(ddl2.SelectedItem.Value.ToString());
SqlDataAdapter sqldataAdapter = new SqlDataAdapter(sqlCommand);
DataSet dataSet = new DataSet();
sqldataAdapter.Fill(dataSet);
//Fill the ListBox
lstBackupfiles.DataSource = dataSet.Tables[0];
lstBackupfiles.DataBind();