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 DataT开发者_高级运维able 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.
You can use Select method on DataTable to get rows matching the Textbox.Text
DT.Select("Name='" & TextBox1.Text & "'")
精彩评论