Combo-box crashing Win-forms C# app

Application data source is an Entity Framework. The Combo-box is bound to the data using a bindingSource control and when I attempt to exit the application the combo-box goes blank and the application hangs. It doesnt close and no further mouse clicks are accepted.

Interestingly I see that the SelectedIndexChanged event happens multiple times when I move between records using the navigator even when I dont change the combo box and it seems as if something happens to the combo box as I attempt to close the app using the red top right hand x.

There is no other code other than what you see attached and what is generated by VS2010.

You should not link the combobox directly to the dataset, but rather fill it with the results of a query on a dataset so that it is a static copy that doesn't get impacted by any changes, unless you want them to happen - manually, to the underlying dataset.

An alternative would be to assign the dataset as the datasource of a bindingsource which is the datasource for the datagridview. Then on the comboboxes Onselectionchanged event, set the bindsource filter to the criteria of the combobox selection.

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …

This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel.
Part 1 of this series discussed basic error handling code using VBA.
http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail. The methods are covered in more detail in o…