views:

51

answers:

1

Hello there..

Look this http://csharpdotnetfreak.blogspot.com/2009/01/winforms-autocomplete-textbox-using-c.html

i have applied this for City Field textbox that displays the CityNames on Typing as Suggestion

I have taken a DataTable as DataSource which was pre-filled from Database.

I loop through DataTable and Add a CityNames to the AutoCompleteStringCollection

Now Problem is that How do i get Values that is(CityId) when Save My Record to the Database.

A: 

You can use Select method on DataTable to get rows matching the Textbox.Text

DT.Select("Name='" & TextBox1.Text & "'")
Hugo Riley