i have a table in my database that stores store items and their respective prices. i need a code which will, after displaying the items on listview,give the sum of their cost. i.e,

when you use listvie1.items.count only gives you the count of the columns. i want to capture the total cost of loaded items, and display it in a textbox say textsum

hi,
Use Listview.items.count to loop through the items in the list view:

dim MyTotal as Double
dim i as integer

for i=0 to Listview1.items.count-1
      Mytotal +=  Listview1.items(i).Value
next
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.