Saving a two dimensional array into the session

I am leaving out some parts here, but the gist ie here.  I have a 2 dimensional array called questionArray that I am populating through a nested looped query not included below.  

<%DIM questionArray(24,5)

session("questions")=questionArray

Dim test(24,5)
test =session("questions")%> // Line Error is On
<%=test(0,1)%>

I get this error on the commented line above:

Microsoft VBScript runtime error '800a000d'

Type mismatch

/unfquiz/index.asp, line 55

How can this be if I am setting the session array to the new array and they both have the same dimensions?
gdlp2004Asked:
Who is Participating?
 
deighcConnect With a Mentor Commented:
You certainly can store array's in Session variables. So no problem there.

I would try NOT declaring the dimensions of the array when you read it back from the Session variable.

So rather than:

Dim test(24,5)
test =session("questions")%

Try:

Dim test
test =session("questions")%
0
 
Fuzzyfish1000Commented:
I didn't think you could dump arrays into a session variable like that... You might be better concaternating it into a string first, with commas or semicolons seperating it, then use the split command to turn it back into an array when you pull it out of the session variable.
0
All Courses

From novice to tech pro — start learning today.