any idea how to use autocomplete in the textbox getting the records from database? i tried using the properties of textbox. But if the table is updated then autocompleteCustomSource is not updated... please guide me.. thank u.

Hi,

You can try this:

For Each dr As DataRow In myDataSet.myTable.Rows
	Me.toolStripTextBox1.AutoCompleteCustomSource.Add(dr("myColumn").ToString())
Next

Make sure you have your AutoCompleteSource set to CustomSource.

Comments
Thank u :)

Thank u... still not working... i just check my code again.. God bless u :)

Hi,

What I meant with " myColumn" is the name of the column you want to be added into the autocomplete textbox.

yeah that's what i did...

For Each dRow In ds.Tables(0).Rows
            txt.AutoCompleteCustomSource.Add(dRow("Description").ToString
Next

just checking my entire code esp my condition in retrieving record(s)... thanx...

This question has already been answered. Start a new discussion instead.