dotnetnube
Member
- Joined
- Aug 20, 2008
- Messages
- 8
- Programming Experience
- Beginner
I have the code below:
Dim criteriaList As Hashtable
Dim criteriaElement As DictionaryEntry
criteriaList.Clear()
criteriaList.Add("FileDateTime", "04/02/2009 19:14:35")
criteriaList.Add("BusinessLocation", "Los Angeles")
criteriaList.Add("ReportDate", "04/02/2009")
For Each criteriaElement In criteriaList
'// Code here
Next
Here is my question: When I do a ForEach to go through the criteriaList hashtable, why is the item with "ReportDate" always at position (0)? I would expect it to be at position (2).
When I iterate through the ForEach, I need the items to be in the same order that they were added to the criteriaList Hashtable above.
Thanks in advance!
Dim criteriaList As Hashtable
Dim criteriaElement As DictionaryEntry
criteriaList.Clear()
criteriaList.Add("FileDateTime", "04/02/2009 19:14:35")
criteriaList.Add("BusinessLocation", "Los Angeles")
criteriaList.Add("ReportDate", "04/02/2009")
For Each criteriaElement In criteriaList
'// Code here
Next
Here is my question: When I do a ForEach to go through the criteriaList hashtable, why is the item with "ReportDate" always at position (0)? I would expect it to be at position (2).
When I iterate through the ForEach, I need the items to be in the same order that they were added to the criteriaList Hashtable above.
Thanks in advance!