HI
I am using nested SortedDictionary in my code as SortedDictionary<string, SortedDictionary<string, int>> but not able to use value stored in this object.
Please find the code which i am using
SortedDictionary<string, SortedDictionary<string, int>> baseItemCounts =
new SortedDictionary<string, SortedDictionary<string, int>>();
baseItemCounts.Add("1450", new SortedDictionary<string, int>());
baseItemCounts["1450"].Add("1450M", 15);
I want to print these values on screen. but don’t know how to access it.
1450
1450M ==== 15
Please some one can help?
SwDevMan81 is correct: baseItemCounts[“1450”][“1450M”] will return 15.
If you want to go through the list and return sorted values, try this:
Remember to iterate by keys so that you get the benefit of the sorting.