View Data in List View using TextBox and Button

Joined
Jan 6, 2012
Messages
5
Programming Experience
Beginner
I used a ListView,Button and a textbox

i created a method this is the code:
Me.ListView1.Items.Clear()
con.Open()
Dim cmd As New Odbc.OdbcCommand("Select PatientID,PatientName FROM patientpersonal WHERE PatientName = '" & TextBox1.Text & "' ", con)
read = cmd.ExecuteReader
While read.Read
Dim str(2) As String
Dim itm As ListViewItem
str(1) = read.Item(0)
str(2) = read.Item(1)
itm = New ListViewItem(str)
Me.ListView1.Items.Add(itm)
End While
con.Close()

And call it in the button and then make it run then when i type and one letter in the textbox and click the button it does not view result
it need to type the whole name of the data to view the result can you give me help pls
 
Back
Top