I have a form in my program that has two drop downs and three buttons. When I run the form, I want the two drop downs to be blank, and one of the buttons to be disabled. I had this setup and working fine, but I have since been working on other classes and forms in the program and, coming back to refine some things, I have found that the code no longer works. The lines in particular are:
private void mainForm_Load(object sender, EventArgs e)
{
this.roomsTableAdapter.Fill(this.bookingSystemDatabaseDataSet.rooms);
timeBox.ResetText();
roomBox.ResetText();
updateTextOutput();
bookButton.Enabled = false;
}
The first line uses a TableAdapter to fill the associated 'rooms' drop down box, which works, however the code after this line does not seem to be executed at all. Commenting out the line means that they are executed, but obviously my 'rooms' drop down would be empty. I have tried moving the lines to the main execution point of the form, but the same thing happens.
Furthermore, I have tried to fill the 'rooms' drop down in 'other ways', including:
roomBox.DataSource = roomsTableAdapter.Fill(bookingSystemDatabaseDataSet.rooms);
and:
roomsTableAdapter.Fill(bookingSystemDatabaseDataSet.rooms);
roomBox.DataSource = roomsTableAdapter;
Of course, these attempts are very similar, but I figured I'd give it a shot. As it turns out, the exact same thing happens in each case; the 'roomBox' is filled, then the rest of the code is ignored. Debugging by stepping through backs up what I already thought to be true, the code is not even executed as far as I can tell. There are no errors, and the program runs, so why are these lines being ignored?