Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27056

VS 2010 [RESOLVED] A list of collections?

$
0
0
Is it possible to have a list of collections? Suppose I create a collection that has 3 key/value pairs to represent an item that has a part number, a description & a price. Now I want to create a list of many of these collections to represent a bunch of parts that I can then pass to a function & loop through them. I tried something like this:

Code:

        Dim itemList As New List(Of Collection)
        Dim itemColl As New Collection
        itemColl.Add("12345", "partnum")
        itemColl.Add("Item1", "desc")
        itemColl.Add("5.00", "price")
        itemList.Add(itemColl)

I can add one collection to the list, but I dont know how to add more. I'm probably going about this all wrong ... can anyone suggest a better way to do what I'm trying to do? Thanks...

Viewing all articles
Browse latest Browse all 27056


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>