Function for adding datebase values to listviewin vb.net
------------------------------------------------------------------------------------
Public Sub list()
ListView1.Items.Clear()
Dim cal As String = "Select slno,code,name,rrate,wrate from stock"
Dim dt As New DataTable
dt = obj.call1(cal)
Dim i, j As Integer
j = dt.Rows.Count
If j > 0 Then
For i = 0 To j - 1
Dim asd As New ListViewItem(dt.Rows(i)("slno").ToString())
asd.SubItems.Add(dt.Rows(i)("Name").ToString())
asd.SubItems.Add(dt.Rows(i)("code").ToString())
asd.SubItems.Add(dt.Rows(i)("wrate").ToString())
asd.SubItems.Add(dt.Rows(i)("rrate").ToString())
ListView1.Items.Add(asd)
Next
End If
End Sub
-------------------------------------------------------------------------------------
1 comment:
how can you add your Rrate column
Post a Comment