Dim sqlQuery As String = " select Product, Amount, PriceBuy, PriceTotal from vwBill where idbill = '" & FrmCheckBill.idbill & "' "
Dim sqlDa As New SqlDataAdapter
Dim sqlComm As New SqlCommand
Dim Tablelvg As New DataTable
Dim sqlDs As New DataSet
With sqlComm
.CommandText = sqlQuery
.Connection = sqlConn
End With
sqlDa = New SqlDataAdapter(sqlQuery, sqlConn)
sqlDs = New DataSet
sqlDa.Fill(Tablelvg)
Try
For i = 0 To Tablelvg.Rows.Count - 1
Dim arr As String() = New String(4) {}
Dim itm As ListViewItem 'add items to ListView
AnyString(e.Graphics, arr(0) = Tablelvg.Rows(i)("product").ToString(), 10, 115)
AnyString(e.Graphics, arr(1) = Tablelvg.Rows(i)("Amount").ToString(), 130, 115)
AnyString(e.Graphics, arr(2) = Tablelvg.Rows(i)("PriceBuy").ToString(), 160, 115)
AnyString(e.Graphics, arr(3) = Tablelvg.Rows(i)("PriceTotal").ToString(), 200, 115)
itm = New ListViewItem(arr)
lsvProductList.Items.Add(itm)
Next
Catch ex As Exception
End Try
End Sub