Hi guys,

I want to search a customer when i press an alphabet 'a' it should search and show drop down list of all customer those name start with 'a'.

Please please help thanks in advance.

Recommended Answers

All 6 Replies

Hi,

You can find a tutorial, here.

Actully i want to auto complete or sugesseted from database.

You need to fill the AutoCompleteSource of the textbox with the names of the customers. This can be done by a for loop.

Follow this:
Set the AutoCompleteSource property of the textbox to CustomSource and the AutoCompleteMode property to Suggest.
Then write this in the Load Event of the form.

YourTextBox.AutoCompleteCustomSource.Clear

For i As Integer = 0 to (YourDataSet.Tables("Table").Rows.Count-1)
  YourTextBox.AutoCompleteCustomSource.Add(YourDataSet.Tables("Table").Rows(i).Item(Required)
Next i

You can experiment with the AutoCompleteModes to see which one mostly suits you're requirements.

i am getting error on (required) is not declared.

YourTextBox.AutoCompleteCustomSource.Add(YourDataSet.Tables("Table").Rows(i).Item(Required)

Hi,

If your using that part of code like this:

YourTextBox.AutoCompleteCustomSource.Add(YourDataSet.Tables("Table").Rows(i).Item(Required)

Then of course you have some difficulties:

What's the name of your textbox....
What's the name of your Dataset....
What's the name of your Table....
Required.....

Change that and see what's happening with the Error...

Thanks for you reply i have already resolved the problem was not this.

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.