By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,165 Members | 1,916 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,165 IT Pros & Developers. It's quick & easy.

Session variable as string (array)

P: n/a
Hello,
I have a web project in Visual Basic 2005. I want to create a session
variable in the "global.asax" file as an array of strings type. The syntax I
use is the following:

Session("MyArray")(10, 10) = ""

but I get an error. I think that I don't know the syntax correctly. Someone
knows it?
Thanks, John.

May 13 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a

Just declare the variables as you normally do then set it to the session
object

Session("MyArray")=VarHoldingArray

to read it from session

VarHoldingArray=Session("MyArray")

regards
Michel Posseth
"juan" <ju**@discussions.microsoft.com> schreef in bericht
news:2A**********************************@microsof t.com...
Hello,
I have a web project in Visual Basic 2005. I want to create a session
variable in the "global.asax" file as an array of strings type. The syntax
I
use is the following:

Session("MyArray")(10, 10) = ""

but I get an error. I think that I don't know the syntax correctly.
Someone
knows it?
Thanks, John.

May 14 '06 #2

P: n/a
yes, but how I say to Visual Basic 2005 that it is an array?
Thanks, John.

"Michel Posseth [MCP]" wrote:

Just declare the variables as you normally do then set it to the session
object

Session("MyArray")=VarHoldingArray

to read it from session

VarHoldingArray=Session("MyArray")

regards
Michel Posseth
"juan" <ju**@discussions.microsoft.com> schreef in bericht
news:2A**********************************@microsof t.com...
Hello,
I have a web project in Visual Basic 2005. I want to create a session
variable in the "global.asax" file as an array of strings type. The syntax
I
use is the following:

Session("MyArray")(10, 10) = ""

but I get an error. I think that I don't know the syntax correctly.
Someone
knows it?
Thanks, John.


May 14 '06 #3

P: n/a
Juan,

I don't think that it is clever to update the array in the session.
Why don't you not as Michel tells you in fact do that outside that and add
that than again to the session.

Just my thought,

Cor

"juan" <ju**@discussions.microsoft.com> schreef in bericht
news:BC**********************************@microsof t.com...
yes, but how I say to Visual Basic 2005 that it is an array?
Thanks, John.

"Michel Posseth [MCP]" wrote:

Just declare the variables as you normally do then set it to the session
object

Session("MyArray")=VarHoldingArray

to read it from session

VarHoldingArray=Session("MyArray")

regards
Michel Posseth
"juan" <ju**@discussions.microsoft.com> schreef in bericht
news:2A**********************************@microsof t.com...
> Hello,
> I have a web project in Visual Basic 2005. I want to create a session
> variable in the "global.asax" file as an array of strings type. The
> syntax
> I
> use is the following:
>
> Session("MyArray")(10, 10) = ""
>
> but I get an error. I think that I don't know the syntax correctly.
> Someone
> knows it?
> Thanks, John.
>


May 14 '06 #4

P: n/a
I don't want to update de array in the session. Only say to Visual Basic 2005
that the variable is really an array with 2 dimensions of 10 elements each. I
use this syntax:

Session("MyArray")(10, 10) = ""

Regards, John

"Cor Ligthert [MVP]" wrote:
Juan,

I don't think that it is clever to update the array in the session.
Why don't you not as Michel tells you in fact do that outside that and add
that than again to the session.

Just my thought,

Cor

"juan" <ju**@discussions.microsoft.com> schreef in bericht
news:BC**********************************@microsof t.com...
yes, but how I say to Visual Basic 2005 that it is an array?
Thanks, John.

"Michel Posseth [MCP]" wrote:

Just declare the variables as you normally do then set it to the session
object

Session("MyArray")=VarHoldingArray

to read it from session

VarHoldingArray=Session("MyArray")

regards
Michel Posseth
"juan" <ju**@discussions.microsoft.com> schreef in bericht
news:2A**********************************@microsof t.com...
> Hello,
> I have a web project in Visual Basic 2005. I want to create a session
> variable in the "global.asax" file as an array of strings type. The
> syntax
> I
> use is the following:
>
> Session("MyArray")(10, 10) = ""
>
> but I get an error. I think that I don't know the syntax correctly.
> Someone
> knows it?
> Thanks, John.
>


May 15 '06 #5

P: n/a

Dim varHoldingArray(10, 10) As String
Session("MyArray") = varHoldingArray

from our response you could have find the above solution

regards

Michel Posseth [MCP]

"juan" wrote:
I don't want to update de array in the session. Only say to Visual Basic 2005
that the variable is really an array with 2 dimensions of 10 elements each. I
use this syntax:

Session("MyArray")(10, 10) = ""

Regards, John

"Cor Ligthert [MVP]" wrote:
Juan,

I don't think that it is clever to update the array in the session.
Why don't you not as Michel tells you in fact do that outside that and add
that than again to the session.

Just my thought,

Cor

"juan" <ju**@discussions.microsoft.com> schreef in bericht
news:BC**********************************@microsof t.com...
yes, but how I say to Visual Basic 2005 that it is an array?
Thanks, John.

"Michel Posseth [MCP]" wrote:

>
> Just declare the variables as you normally do then set it to the session
> object
>
> Session("MyArray")=VarHoldingArray
>
> to read it from session
>
> VarHoldingArray=Session("MyArray")
>
> regards
>
>
> Michel Posseth
>
>
> "juan" <ju**@discussions.microsoft.com> schreef in bericht
> news:2A**********************************@microsof t.com...
> > Hello,
> > I have a web project in Visual Basic 2005. I want to create a session
> > variable in the "global.asax" file as an array of strings type. The
> > syntax
> > I
> > use is the following:
> >
> > Session("MyArray")(10, 10) = ""
> >
> > but I get an error. I think that I don't know the syntax correctly.
> > Someone
> > knows it?
> > Thanks, John.
> >
>
>
>


May 15 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.