0

Dont know the application switches to my form that makes use of odbc when I close the application.

protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

As I step through, when it gets to components.Dispose(), it goes to

private void TerminalStatus_SelectedIndexChanged(object sender, EventArgs e)//START OF GRIDVIEW 3(PROGRESS REPORT)
        {// LOAD AND VIEW THE STATUS OF EACH TERMINAL, THIS IS READ FROM A CSV FILE.
2
Contributors
2
Replies
3
Views
4 Years
Discussion Span
Last Post by Ketsuekiame
0

Okay on the form is a combobox that binds data from a DB. If I dispose the combobox control, in the Dispose Method, then the app closes properly...but do i really need to add a line of code for that? It worked fine before - lol.

1

Could this possibly be an order of execution problem?

I imagine something else is being disposed before your combo box, which changes the selected index? (Any other data-binding anywhere?)
If so, this would cause your event to fire before the control was disposed.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.