King Umar

King Umar

  • NA
  • 103
  • 29.9k

how retrieve data from from database into a listview?

Sep 1 2015 9:21 PM
how to retrieve data from microsoft sql server 2013 into listview in vb.net(visual studio2013),i already have the codes that retrieve automatic ( by array ) but my project require me to need codes that have to customize this process, 
 
For i = 0 To ds.Tables(0).Rows.Count - 1
For j = 0 To ds.Tables(0).Columns.Count - 1
 itemcoll(j) = ds.Tables(0).Rows(i)(j).ToString()
Next
Dim bb As New ListViewItem(itemcoll)
Me.ListView1.Items.Add(bb)
Next

this is the codes for the array retrieve but my project require me to need a manual ( customize ) 
 it would look something like..
 For i = 0 To ds.Tables(0).Rows.Count - 1
ListView1.View = ds.Tables("AddItem").Rows(0)("Serial_Number").ToString
ListView1.View = ds.Tables("AddItem").Rows(0)("PO_Number").ToString
ListView1.View = ds.Tables("AddItem").Rows(0)("Vendor").ToString
ListView1.View = ds.Tables("AddItem").Rows(0)("Category").ToString
ListView1.View = ds.Tables("AddItem").Rows(0)("DO_Date").ToString
Next
correct me if i'm wrong..can anyone help...anyone got any idea

Answers (1)