0

Greeting,

Can somebody help me with this code i don't know what is the problem here

Dim str As String = "SELECT DISTINCT FirstName,LastName FROM SessionMembers ORDER by FirstName, LastName asc"
        Dim cmdStr As New SqlCommand(str, con)
        Dim dtreader As SqlDataReader = cmdStr.ExecuteReader()

        While dtreader.Read
            stringCols.AddRange(New String() {dtreader(0).ToString})
            stringCols2.AddRange(New String() {dtreader(1).ToString})
        End While
        dtreader.Close()
        LastNameTF.AutoCompleteCustomSource = stringCols2
        FirstNameTF.AutoCompleteCustomSource = stringCols
        FirstNameTF.AutoCompleteMode = AutoCompleteMode.SuggestAppend
        LastNameTF.AutoCompleteMode = AutoCompleteMode.SuggestAppend
        con.Close()

Thank you in advance.

2
Contributors
1
Reply
8
Views
4 Years
Discussion Span
Last Post by Jx_Man
0

Add this lines :

FirstNameTF.AutoCompleteSource = AutoCompleteSource.CustomSource
LastNameTF.AutoCompleteSource = AutoCompleteSource.CustomSource
This question has already been answered. 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.