Session variable as string (array)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • juan

    Session variable as string (array)

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

    Session("MyArra y")(10, 10) = ""

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

  • Michel Posseth  [MCP]

    #2
    Re: Session variable as string (array)


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

    Session("MyArra y")=VarHoldingA rray

    to read it from session

    VarHoldingArray =Session("MyArr ay")

    regards


    Michel Posseth


    "juan" <juan@discussio ns.microsoft.co m> schreef in bericht
    news:2AD3B7B6-1A4B-4A4C-860F-BAFC108973C3@mi crosoft.com...[color=blue]
    > Hello,
    > I have a web project in Visual Basic 2005. I want to create a session
    > variable in the "global.asa x" file as an array of strings type. The syntax
    > I
    > use is the following:
    >
    > Session("MyArra y")(10, 10) = ""
    >
    > but I get an error. I think that I don't know the syntax correctly.
    > Someone
    > knows it?
    > Thanks, John.
    >[/color]


    Comment

    • juan

      #3
      Re: Session variable as string (array)

      yes, but how I say to Visual Basic 2005 that it is an array?
      Thanks, John.

      "Michel Posseth [MCP]" wrote:
      [color=blue]
      >
      > Just declare the variables as you normally do then set it to the session
      > object
      >
      > Session("MyArra y")=VarHoldingA rray
      >
      > to read it from session
      >
      > VarHoldingArray =Session("MyArr ay")
      >
      > regards
      >
      >
      > Michel Posseth
      >
      >
      > "juan" <juan@discussio ns.microsoft.co m> schreef in bericht
      > news:2AD3B7B6-1A4B-4A4C-860F-BAFC108973C3@mi crosoft.com...[color=green]
      > > Hello,
      > > I have a web project in Visual Basic 2005. I want to create a session
      > > variable in the "global.asa x" file as an array of strings type. The syntax
      > > I
      > > use is the following:
      > >
      > > Session("MyArra y")(10, 10) = ""
      > >
      > > but I get an error. I think that I don't know the syntax correctly.
      > > Someone
      > > knows it?
      > > Thanks, John.
      > >[/color]
      >
      >
      >[/color]

      Comment

      • Cor Ligthert [MVP]

        #4
        Re: Session variable as string (array)

        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" <juan@discussio ns.microsoft.co m> schreef in bericht
        news:BCEA720A-BACD-4EE8-95EF-2E3FE2E284F8@mi crosoft.com...[color=blue]
        > yes, but how I say to Visual Basic 2005 that it is an array?
        > Thanks, John.
        >
        > "Michel Posseth [MCP]" wrote:
        >[color=green]
        >>
        >> Just declare the variables as you normally do then set it to the session
        >> object
        >>
        >> Session("MyArra y")=VarHoldingA rray
        >>
        >> to read it from session
        >>
        >> VarHoldingArray =Session("MyArr ay")
        >>
        >> regards
        >>
        >>
        >> Michel Posseth
        >>
        >>
        >> "juan" <juan@discussio ns.microsoft.co m> schreef in bericht
        >> news:2AD3B7B6-1A4B-4A4C-860F-BAFC108973C3@mi crosoft.com...[color=darkred]
        >> > Hello,
        >> > I have a web project in Visual Basic 2005. I want to create a session
        >> > variable in the "global.asa x" file as an array of strings type. The
        >> > syntax
        >> > I
        >> > use is the following:
        >> >
        >> > Session("MyArra y")(10, 10) = ""
        >> >
        >> > but I get an error. I think that I don't know the syntax correctly.
        >> > Someone
        >> > knows it?
        >> > Thanks, John.
        >> >[/color]
        >>
        >>
        >>[/color][/color]


        Comment

        • juan

          #5
          Re: Session variable as string (array)

          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("MyArra y")(10, 10) = ""

          Regards, John

          "Cor Ligthert [MVP]" wrote:
          [color=blue]
          > 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" <juan@discussio ns.microsoft.co m> schreef in bericht
          > news:BCEA720A-BACD-4EE8-95EF-2E3FE2E284F8@mi crosoft.com...[color=green]
          > > yes, but how I say to Visual Basic 2005 that it is an array?
          > > Thanks, John.
          > >
          > > "Michel Posseth [MCP]" wrote:
          > >[color=darkred]
          > >>
          > >> Just declare the variables as you normally do then set it to the session
          > >> object
          > >>
          > >> Session("MyArra y")=VarHoldingA rray
          > >>
          > >> to read it from session
          > >>
          > >> VarHoldingArray =Session("MyArr ay")
          > >>
          > >> regards
          > >>
          > >>
          > >> Michel Posseth
          > >>
          > >>
          > >> "juan" <juan@discussio ns.microsoft.co m> schreef in bericht
          > >> news:2AD3B7B6-1A4B-4A4C-860F-BAFC108973C3@mi crosoft.com...
          > >> > Hello,
          > >> > I have a web project in Visual Basic 2005. I want to create a session
          > >> > variable in the "global.asa x" file as an array of strings type. The
          > >> > syntax
          > >> > I
          > >> > use is the following:
          > >> >
          > >> > Session("MyArra y")(10, 10) = ""
          > >> >
          > >> > but I get an error. I think that I don't know the syntax correctly.
          > >> > Someone
          > >> > knows it?
          > >> > Thanks, John.
          > >> >
          > >>
          > >>
          > >>[/color][/color]
          >
          >
          >[/color]

          Comment

          • M. Posseth

            #6
            Re: Session variable as string (array)


            Dim varHoldingArray (10, 10) As String
            Session("MyArra y") = varHoldingArray

            from our response you could have find the above solution



            regards

            Michel Posseth [MCP]



            "juan" wrote:
            [color=blue]
            > 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("MyArra y")(10, 10) = ""
            >
            > Regards, John
            >
            > "Cor Ligthert [MVP]" wrote:
            >[color=green]
            > > 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" <juan@discussio ns.microsoft.co m> schreef in bericht
            > > news:BCEA720A-BACD-4EE8-95EF-2E3FE2E284F8@mi crosoft.com...[color=darkred]
            > > > 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("MyArra y")=VarHoldingA rray
            > > >>
            > > >> to read it from session
            > > >>
            > > >> VarHoldingArray =Session("MyArr ay")
            > > >>
            > > >> regards
            > > >>
            > > >>
            > > >> Michel Posseth
            > > >>
            > > >>
            > > >> "juan" <juan@discussio ns.microsoft.co m> schreef in bericht
            > > >> news:2AD3B7B6-1A4B-4A4C-860F-BAFC108973C3@mi crosoft.com...
            > > >> > Hello,
            > > >> > I have a web project in Visual Basic 2005. I want to create a session
            > > >> > variable in the "global.asa x" file as an array of strings type. The
            > > >> > syntax
            > > >> > I
            > > >> > use is the following:
            > > >> >
            > > >> > Session("MyArra y")(10, 10) = ""
            > > >> >
            > > >> > but I get an error. I think that I don't know the syntax correctly.
            > > >> > Someone
            > > >> > knows it?
            > > >> > Thanks, John.
            > > >> >
            > > >>
            > > >>
            > > >>[/color]
            > >
            > >
            > >[/color][/color]

            Comment

            Working...