spacer    
Blog Search
Others' posts of interest
Recent del.icio.us tags
Consumer evaluation of mental health and substance abuse providers - sharing experiences on the web
Mar 1

Written by: Matthew Hile
3/1/2006 7:13 AM

To save/consume a multidimensional array to a session variable in .NET you use the following steps.

  • Store the array
    • Create the array
Dim aToSave(0, 1) As Integer ' a 10x2 array
' Populate the array with values
  • Save it to a session variable
Session("aToSave") = aToSave
  • Restore the array
    • Create an array to hold the saved value
Dim aToSave(0, 1) As Integer ' a 10x2 array
    • Convert the saved variable to the appropriate type and assigne it
aToSave= CType(Session("aToSave"), Integer(,))
It was this last step the threw me. The "Integer(,)" converts the session variable to an interger array with two dimensions. If it were a two dimensional character array you would use "Char(,)"

Tags:

Your name:
Title:
Comment:
Add Comment    Cancel  
Disclaimer
NOTE: The ideas, opinions, and viewpoints expressed in these entries are solely those of the author.
There are no categories in this blog.
 
Missouri Institute of Mental Health    Terms Of Use    Privacy Statement