-1

Private Sub autocus()
Call main()
Con.Open()

Dim cmd As New SqlCommand("SELECT cust_order FROM Inventory", Con)

Dim ds As New DataSet
Dim da As New SqlDataAdapter(cmd)
da.Fill(ds, "My List") 'list can be any name u want

Dim col As New AutoCompleteStringCollection
Dim i As Integer
For i = 0 To ds.Tables(0).Rows.Count - 1
col.Add(ds.Tables(0).Rows(i)("cust_order").ToString())
Next
txt4.AutoCompleteSource = AutoCompleteSource.CustomSource
txt4.AutoCompleteCustomSource = col
txt4.AutoCompleteMode = AutoCompleteMode.Suggest
Con.Close()

End Sub

Votes + Comments
No context. Don't know if this is a question or sample code.
2
Contributors
2
Replies
14
Views
5 Years
Discussion Span
Last Post by Reverend Jim
0

Is this a sample of code that works or is it a piece of code that you are having a problem with?

If it is the first then you should explain what it does and how. If it is the second then you should explain what you are trying to do and what you are having a problem with.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.