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.

commented: Thank u :) +3

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...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.