Note that there are some explanatory texts on larger screens.

plurals
  1. POSome lines of code in form not being executed?
    primarykey
    data
    text
    <p>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:</p> <pre><code>private void mainForm_Load(object sender, EventArgs e) { this.roomsTableAdapter.Fill(this.bookingSystemDatabaseDataSet.rooms); timeBox.ResetText(); roomBox.ResetText(); updateTextOutput(); bookButton.Enabled = false; } </code></pre> <p>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.</p> <p>Furthermore, I have tried to fill the 'rooms' drop down in 'other ways', including:</p> <pre><code>roomBox.DataSource = roomsTableAdapter.Fill(bookingSystemDatabaseDataSet.rooms); </code></pre> <p>and:</p> <pre><code>roomsTableAdapter.Fill(bookingSystemDatabaseDataSet.rooms); roomBox.DataSource = roomsTableAdapter; </code></pre> <p>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?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload