hi,
Please help me with my listview. The listview did'nt show any list items.
here's my code:
Private Sub txtSearch_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtSearch.TextChanged
Dim strSearch As String
strSearch = "SELECT * FROM tblMobileTracking WHERE accountNumber LIKE '" & txtSearch.Text & "%'"
myConnection.Open()
Dim cmdAcctNum As OleDbCommand = New OleDbCommand(strSearch, myConnection)
Dim objDataReader As OleDbDataReader = cmdAcctNum.ExecuteReader
If objDataReader.Read = 0 Then
End If
Try
lvwSearch.Items.Clear()
While objDataReader.Read
Dim lv As New ListViewItem
With lv
.Text = objDataReader.Item("accountNumber")
.SubItems.Add(objDataReader("division"))
.SubItems.Add(objDataReader("Assignee"))
.SubItems.Add(objDataReader("phoneUnitModel"))
.SubItems.Add(objDataReader("handPhoneNumber"))
End With
lvwSearch.Items.Add(lv)
End While
Catch ex As Exception
MsgBox(ex.Message)
End Try
myConnection.Close()
End Sub