VB.NET - How to show particular data (display member) in listview...Please Help Me

Asked By Jayanta Modak on 07-Jul-17 08:22 AM
Hello

I create a project in vb.net 2010 with access database. I want to show data in listview. It Is show in listview but a problem I entry Id wise. So, when I click on the show data button I see the Id . How to show the id wise actual data.

I use the code for data load in listview1

https://ibb.co/dMxxua
https://ibb.co/fHTgLF
https://ibb.co/b4bCSv
https://ibb.co/eRmqEa

What I have tried:

Public Sub Displayitem()
        ListView1.Items.Clear()
        Dim cmd As New OleDb.OleDbCommand("SELECT * FROM pur_inv ORDER BY purinvdt", cn)
        Dim dr As OleDb.OleDbDataReader = cmd.ExecuteReader()
        Do While dr.Read()
            Dim new_item As New  _
     ListViewItem(dr.Item("purinvdt").ToString)
            new_item.SubItems.Add(dr.Item("purinvid").ToString)
            new_item.SubItems.Add(dr.Item("prtid").ToString)
            new_item.SubItems.Add(dr.Item("invtypid").ToString)
            new_item.SubItems.Add(dr.Item("taxamt").ToString)
            new_item.SubItems.Add(dr.Item("tottaxblamt").ToString)
            new_item.SubItems.Add(dr.Item("invamt").ToString)
            ListView1.Items.Add(new_item)
        Loop
    End Sub