Tuesday, October 14, 2003

Databinding in ComboBox causes some odd problems

I did a short contract for a chap a while back and got the job of fixing his broken VB application. The symptoms were that of a crash but turned out to be a race condition caused by using a ComboBox control that was populated by a database using databinding. The SelectedIndexChanged event was wired automatically to the handler which went off and updated the form, changing the contents of the same combo box. Databinding fires SelectedIndexChanged and so this became a vicious cycle and the machine slowed to a crawl while the database thrashed the disk. I just posted a solution in tips and tricks...

No comments: