I Have A DataTable In MSAccess TbJform and I want to Show the Columns of TbJform in ListView.................The Columns Are JformNo,JformDate,PartyName,Bags,Packing,Loose etc.............now what sholud i do to show the all the colmns in listview...

 qstr ="SELECTJformNo,JformDate,ActCode,Bags,Packing,Loose,Weight,Rate,NetAmount From tbJform Where DivisionCode = " & CmbDivision.SelectedValue & " "
                ad = New OleDbDataAdapter(qstr, cn)
                ds = New DataSet
                ad.Fill(ds, "tbJform")

                Dim i As Integer
                For i = 0 To ds.Tables("tbJform").Rows.Count() - 1
                    Dim str1 As Integer = ds.Tables("tbJform").Rows(0).Item("JformNo").ToString
                    'Dim str2 As Integer = ds.Tables("tbJform").Rows(0).Item("JfromDate").ToString
                    Dim str3 As Integer = ds.Tables("tbJform").Rows(0).Item("ActCode").ToString
                    Dim str4 As Integer = ds.Tables("tbJform").Rows(0).Item("Bags").ToString
                    Dim str5 As Integer = ds.Tables("tbJform").Rows(0).Item("Packing").ToString

                    Dim lvi As New ListViewItem 'create new listview item
                    lvi.Text = str1 'Put text in column 1

                    lvi.SubItems.AddRange(New String() {str1, str3, str4, str5}) 'Put text in columns 2,3,4,5
                    ListViewJform.Items.Add(lvi) 'Add the new row to listview

      I Have tried this code .......bt i cnt get the Value.........I am doing this code on the keydown of another listbox
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.