Results 1 to 3 of 3

Thread: DictionaryBase

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2006
    Posts
    19

    DictionaryBase

    Originally made a collection class inheriting system.collections.generic.dictionary(of integer,myObject)
    when looping through the objects of the collection, they were in exactly the same order as added.

    I then realised I should of probably been using inherit system.collections.dictionarybase
    looping through the objects this time gave me a different order than when they were added.

    I am confused as to why the difference, hoping someone maybe able to explain.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: DictionaryBase

    The order of items in a dictionary is not relevant. Dictionary items are retrieved by their key. The .NET Framework provides the SortedList, Generic.SortedList and Generic.SortedDictionary classes if order is important. You should read the help topics for each of those classes.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jul 2006
    Posts
    19

    Re: DictionaryBase

    I already read the help on all of those.
    However, that wasn't the question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width