troubleshooting Question

Replaced textboxes with comboboxes - now I get "An unhandled exception of type 'System.StackOverflowException' occurred in *****.exe"

Avatar of TSFLLC
TSFLLC asked on
Visual Basic.NET
22 Comments1 Solution525 ViewsLast Modified:
I have a Windows form that previously contained custom AutoComplete functionality and was tied to about 15 textboxes.  I just finished stripping those textboxes and replacing them with standard unbound comboboxes with AutoComplete turned on.

EVERY time I open the form, access a record or two.  THEN I close and reopen the form.  WHEN I POPULATE EITHER THE FIRST OR SECOND RECORD AGAIN....StackOverflowException.  Until I replaced textboxes with comboboxes, this form has worked for three years.

I don't ever use comboboxes.  So there are several things to note that I may or may not be doing correctly when using VB's combobox.  

1)  With my original autocomplete, I never performed a cmbobox.DataSource = dv, combobox.DisplayMember = "id", cmbobox.ValueMember = "desc" etc. until the textbox was active. Also, my autocomplete used a listbox instead of a combobox.  Now, I create With combobox.DataSource etc. for ALL of these comboboxes on FormLoad.  Is this appropriate or should I do this individually only when each combobox is accessed?

2)  When I populate the form using a dataview I populate the comboboxes with the .SelectedValue and not .Text.  It eleviates having to join all of these tables to my main table in a SQL select.  Is this inappropriate?  Should I set .Text?
Join our community to see this answer!
Unlock 1 Answer and 22 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 22 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros