Click to See Complete Forum and Search --> : List Dictionary Keys and values


keeps21
02-17-2009, 11:20 AM
I have a list Dictionary.
It is populated from my database, with a question ID and an answer as shown below.


Dim AnswerArray As New ListDictionary()
While MyDataReader.Read
AnswerArray.add(MyDataReader("form_question_id"), MyDataReader("answer"))
End While


How can I then output both the question ID and the answer using a foreach loop from this list dictionary. The following code only outputs the answer from the list. I want both.

For Each Item in AnswerArray
Response.Write(AnswerArray(Item.Key))
Next


Thanks for any help.

keeps21
02-19-2009, 04:42 AM
Solved my problem by rewriting the code to not use ListDictionary.