Question : Puzzling C# Application Crash

I am building an application in C# using Visual Studio 2008. I wanted to add an AutoComplete feature to a Text Box. The Autocomplete data comes out of a Microsoft Access DB. The problem after I type a couple of characters the Application crashes completly. I try to Debug but its not debugging (is this because its C#?).  

I attached the code thats under the TextChanged event and the DB procedure is a pretty standard Select 10 records add to string array.

Anybody have any ideas?
Code Snippet:
1:
2:
3:
4:
5:
6:
private void textBox1_TextChanged(object sender, EventArgs e)
        {
            String[] range = dlc.findAutoComplete(textBox1.Text);
            this.textBox1.AutoCompleteCustomSource.AddRange(range);
            
        }

Answer : Puzzling C# Application Crash

Click Debug then Exceptions and tick all options.  If there is an error it will show on the exact line first.  That is one way to try and resolve this, or at least narrow it down.

As for why this is happening, well it could be that your string[] is being overwhelmed with data.  Try setting it to null after ever textchanged event on the off chance it is not clearing the data.
Random Solutions  
 
programming4us programming4us