ListDictionary Keys and Values

keeps21

Member
Joined
Nov 28, 2008
Messages
8
Programming Experience
1-3
I have a list Dictionary.
It is populated from my database, with a question ID and an answer as shown below.

VB.NET:
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.
VB.NET:
For Each Item in AnswerArray 
Response.Write(AnswerArray(Item.Key))
Next

Thanks for any help.
 
Back
Top