it's a search listview and i want to retrieve the data
all i want is to populate a data in listview per each row

please help...

here's my sample code

Dim objDataReader As OleDbDataReader
        objDataReader = objCommand.ExecuteReader
        If objDataReader.HasRows = 0 Then

            txtCostCenter.Text = ""
            txtDivision.Text = ""
        End If


        While objDataReader.Read

            Dim lvwItem As ListViewItem
          

            With lvwItem

                For Each lvwItem In lstLicense.Items


                    lvwItem.SubItems.Add(16).Text = (objDataReader("Division"))

                Next

            End With

        End While

    End Sub

acutally i am trying to search in listview and i am using column16 to populate the record for the department name the objdatareader is trying to read column15 it's a deparment id for each row, now all i want is to identify column 15 to know the department name

here's my sample code for search

Dim v As Integer
 

       
        Dim aa As ListViewItem
        lstCostCenter.Items.Clear()
        Dim strSQL As String
 
        For Each item2 As ListViewItem In lstLicense.Items
 

            strSQL = "SELECT * FROM tblEndUserDetails WHERE CostCenter Like '" & item2.SubItems(15).Text & "%'"
 
            classLibrary = New ConLib
            classLibrary.openConnection(strConnection)
            lblconstat.Text = DatabaseStatus
            If Not classLibrary.isconnectionopen() Then
                Exit Sub
 
            End If
 
            classLibrary.initializeCommand(strSQL)
 
            populateDatAddCostCenterPopUpBox3()
 
        Next
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.