How to retrieve the records from database into Listview Control in VB ?

Questions by Subashini.Ramasamy   answers by Subashini.Ramasamy

Showing Answers 1 - 6 of 6 Answers

Rakesh

  • Nov 22nd, 2007
 

By using <listbox_name>.additem(<recordset_with_fieldname>)

for ex. listbox's name is list1 and field name is item1, then
list1.additem(rs!item1)

where rs is a recordset

  Was this answer useful?  Yes

aashutosh_r

  • Jul 22nd, 2008
 

Dim z

rs.MoveFirst
Do While Not rs.EOF 
        Set z = lv.ListItems.Add(, , rs!Field1) '

        z.SubItems(1) = rs!Field2
        z.SubItems(2) = rs!Field3
        z.SubItems(3) = rs!Field4
        z.SubItems(4) = rs!Field5
        z.SubItems(5) = rs!Field6
        rs.MoveNext
Loop

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions