Hi, I want to show one table of my access database in a ListView. I tried with this but DataSource isn't a property of ListView.

My table have two colums: "food" and "kilograms". Food column is the primary and unique.

I use VS2010 and .NET Framework 4.0

Hi
You could use a data reader to parse through your records and add them to the listView:

Dim item As ListViewItem
Dim item2 As ListViewItem

While DR.Read
    item2= new ListviewItem(DR("kilograms"))
    item = new ListviewItem(DR("food"))
    item.subitems.add(item2)
    Listview1.items.add(item)
End While
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.