Dim cls As New MyData
Dim dv As DataView
Dim dt As DataTable = cls.GetDataTable("select productid,productname " & _
" from products order by productname")
dv = dt.DefaultView
Dim A1 As New AutoCompleteStringCollection
For Each drv As DataRowView In dv
A1.Add(drv("productname"))
Next
TextBox1.AutoCompleteMode = AutoCompleteMode.Suggest
TextBox1.AutoCompleteSource = AutoCompleteSource.CustomSource
TextBox1.AutoCompleteCustomSource = A1