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.
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.