i'm currently working on my thesis e-voting system. and i need to modify my search candidate and search voter form. the data from my database is already loaded in my listview when the system. what i want to do is while i am typing in the search text box, at the same time the items in my list view is being filtered without clicking the search button. i hope you guys can help me.
this is my code
Private Sub View_Candidate_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
SqlString = "SELECT * FROM candidate order by candidateLname ASC"
'Function for searching by candidate ID number
Using conn As New MySqlConnection(ConnString)
Using cmd As New MySqlCommand(SqlString, conn)
cmd.CommandType = CommandType.Text
conn.Open()
Using reader As MySqlDataReader = cmd.ExecuteReader()
If reader.HasRows = True Then
While reader.Read()
Dim li As New ListViewItem
li.Text = reader("candidateIDno").ToString
li.SubItems.Add(reader("candidateLname").ToString)
li.SubItems.Add(reader("candidateFname").ToString)
li.SubItems.Add(reader("candidateMname").ToString)
li.SubItems.Add(reader("position").ToString)
li.SubItems.Add(reader("partyList").ToString)
lstviewvoter.Items.Add(li)
End While
End If
End Using
End Using
End Using
End Sub