Q:

Text search in database column

im using vb 2010 express edition. I have a database (Sql) and a table "students" in the database. It has a data like this:
                StudentId     Name     Surname     Classs

                2266          Mike     Brown       8
                2773          Carol    Smith       6
                2883          Michel   Old         7
                2773          Miray    Edem        6
                27736         Cindy    Temiz       7
                ......................................
                ......................................

there are lots of students. I want to put a search textbox on my form. User will search a student by name. When user presses a key on search textbox, for example "M" a box will appear and shows students which contains "M". (Mike, Michel, Miray) . It will work like google search. is there any way for me to help for this... Please share your ideas...

A:

You should create a customautocomplete class for your textbox and set its autocomplete 
Something like:
Dim tbox As New TextBox

Dim aCol As New AutoCompleteStringCollection
For Each student As String In dt.results("students")
  aCol.Add()
Next

tbox.AutoCompleteSource = AutoCompleteSource.CustomSource
tbox.AutoCompleteCustomSource = aCol
tbox.AutoCompleteMode = AutoCompleteMode.SuggestAppend

I prefer VB.NET so I have provided an example in VB.NET as no language was specified.

