I have a listbox in which a have a series of cases retrieved from a database. When i create a new case i wan't to update the listBox to reflect the actual state of the cases-table in the database. But I get a NullReferenceException from the event handler for this line: `populateBoxes((int)lb.SelectedValue)` when i try to update it.

This is my event-handler on the listbox:

```
private void lbCases_SelectedIndexChanged(object sender, EventArgs e)
        {
            ListBox lb = (ListBox)sender;

            populateBoxes((int)lb.SelectedValue);
        }

```

The update event:

```
private void button1_Click(object sender, EventArgs e)
        {

            this.casesTableAdapter.Fill(this.caseDB.cases);

        }

```

I've used the built-in feature of VSE2008 to set the datasource, displaymember and valuemember of the listbox.