180 Session memvar..?

  • Thread starter Thread starter Kent Johnson
  • Start date Start date
K

Kent Johnson

Hi all,

I would like to create 180 session variables.
I can do this with:

Session("1")= 1
Session("2")= 2
....
Session("180")= 180

...but would't it be possible to create something like:

For x=1 to 180
Session(" & x & ")= x
next

How should I write the correct syntax?

/Kent J.
 
In my opinion you can just do

For x = 1 To 180
Session(x.ToString) = x
Next

kind regards,

Jurjen de Groot
G.I.T.S., Netherlands.
 
Great! Thanks!

Jurjen de Groot said:
In my opinion you can just do

For x = 1 To 180
Session(x.ToString) = x
Next

kind regards,

Jurjen de Groot
G.I.T.S., Netherlands.
 
A better approach would be to create an array of 180 variables and cache the
array. It's more efficient that way and uses less memory as the CLR can
optimize the array storage, but cannot with session variables.

Regards
 
Back
Top