i have a combo box which contains one table on mySql database and I want to make it more good that when I input a leter all the data that starts on that letter will appear.Example when I type letter "A" all data that starts with letter "A" appears..plz help me..

thank you.

Recommended Answers

All 3 Replies

here.. let me show you

you have to use Autocompletestringcollection

i made a little app. for you .. see this link: http://lh3.ggpht.com/_blnOia1d0Pw/TQxyMJTiRqI/AAAAAAAACc4/s8m4GWX5YkA/autocomplete.jpg

Write the following code for the button 1

Dim books As New AutoCompleteStringCollection

        Dim conn As New SqlConnection("Data Source=NITIN\SQLEXPRESS;Initial Catalog=library;Integrated Security=True")
        Dim cmd As New SqlCommand("select btitle from book", conn)

        conn.Open()

        Dim dr As SqlDataReader = cmd.ExecuteReader()

        While dr.Read()

            books.Add(dr("btitle").ToString())

        End While

        Me.ComboBox1.AutoCompleteSource = AutoCompleteSource.CustomSource
        Me.ComboBox1.AutoCompleteCustomSource = books
        Me.ComboBox1.AutoCompleteMode = AutoCompleteMode.Suggest

i hope it helps

it works..thank you..with this code:

Dim types As New AutoCompleteStringCollection
        Dim conn As New MySqlConnection("server=localhost;username=root;password=" & MySQL_PWD & ";database=DocumentDB")
        Dim cmd As New MySqlCommand("SELECT typeofletter from lettertypes", conn)

        conn.Open()

        Dim dr As MySqlDataReader = cmd.ExecuteReader()

        While dr.Read()

            types.Add(dr("typeofletter").ToString())

        End While

        Me.cmbtype.AutoCompleteSource = AutoCompleteSource.CustomSource
        Me.cmbtype.AutoCompleteCustomSource = types
        Me.cmbtype.AutoCompleteMode = AutoCompleteMode.Suggest

thanks a lot....

can you help me about barcode picture printing...
I have random numbers and that will be the barcode number then I want to convert it to its barcode lines...how to work with it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.