Home All Groups Group Topic Archive Search About

Session variable as string (array)

Author
13 May 2006 5:19 PM
juan
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.

Author
14 May 2006 6:52 AM
Michel Posseth [MCP]
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


Show quoteHide quote
"juan" <j***@discussions.microsoft.com> schreef in bericht
news:2AD3B7B6-1A4B-4A4C-860F-BAFC108973C3@microsoft.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.
>
Author
14 May 2006 10:47 AM
juan
yes, but how I say to Visual Basic 2005 that it is an array?
Thanks, John.

Show quoteHide quote
"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" <j***@discussions.microsoft.com> schreef in bericht
> news:2AD3B7B6-1A4B-4A4C-860F-BAFC108973C3@microsoft.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.
> >
>
>
>
Author
14 May 2006 3:45 PM
Cor Ligthert [MVP]
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

Show quoteHide quote
"juan" <j***@discussions.microsoft.com> schreef in bericht
news:BCEA720A-BACD-4EE8-95EF-2E3FE2E284F8@microsoft.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" <j***@discussions.microsoft.com> schreef in bericht
>> news:2AD3B7B6-1A4B-4A4C-860F-BAFC108973C3@microsoft.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.
>> >
>>
>>
>>
Author
15 May 2006 8:48 AM
juan
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

Show quoteHide quote
"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" <j***@discussions.microsoft.com> schreef in bericht
> news:BCEA720A-BACD-4EE8-95EF-2E3FE2E284F8@microsoft.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" <j***@discussions.microsoft.com> schreef in bericht
> >> news:2AD3B7B6-1A4B-4A4C-860F-BAFC108973C3@microsoft.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.
> >> >
> >>
> >>
> >>
>
>
>
Author
15 May 2006 1:05 PM
M. Posseth
Dim varHoldingArray(10, 10) As String
Session("MyArray") = varHoldingArray

from our response you could have find the above solution



regards

Michel Posseth [MCP]



Show quoteHide quote
"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" <j***@discussions.microsoft.com> schreef in bericht
> > news:BCEA720A-BACD-4EE8-95EF-2E3FE2E284F8@microsoft.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" <j***@discussions.microsoft.com> schreef in bericht
> > >> news:2AD3B7B6-1A4B-4A4C-860F-BAFC108973C3@microsoft.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.
> > >> >
> > >>
> > >>
> > >>
> >
> >
> >