Re: 2 dimension arrays

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Thanks for your reply.
How do I declare an array as a session variable ?
I tried:

int [] marked = new int [50];
Session["marked[0] "] = 2;

I got a syntax error.

"Hans Kesting" wrote:

> Andrew wrote:
> > Hi,
> >
> > I have an array of 50 rows and 2 columns that I want to make
> > available to a user. As he goes thru the system, he will be updating
> > and editing the array. This is unique to each user in the session.
> >
> > eg. public string[,] marked = new String[50][2].
> >
> > How do you suggest I do it ? Do I declare it as global variable, or
> > is it possible to put it as a session variable?
> >
> > TIA. Cheers.
> > Andrew.
>
> You will *need* to put in in Session: a "global variable" (static member of some class)
> is the same for *all* users of your site (the single webapp serves multiple users).
> If you want to retain user-specific data in server-memory, you have to
> user Session. (other options: client side using ViewState or hidden inputs
> or in a database under a user-specific key)
>
>
> Hans Kesting
>
>
>
.



Relevant Pages

  • Re: 2 dimension arrays
    ... > How do I declare an array as a session variable? ... Juan T. Llibre ... >>> Andrew. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: 2 dimension arrays
    ... > How do I declare an array as a session variable? ... as you have a *reference* to this array, there is really only one array ... >> Andrew wrote: ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: 2 dimension arrays
    ... "Hans Kesting" wrote: ... >> How do I declare an array as a session variable? ... No need to "put the changed array back in the Session". ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Passing an array of structuresfrom a pointer?
    ... to only declare structs in headers and then define the ... the struct should be declared ... what if you have a simple array like this: ... In the header we would declare? ...
    (microsoft.public.vc.language)
  • Re: vb.net class
    ... about fixed array lenghts or using ReDim statements. ... code ensures everything in the array is a String because you declare it ... Count can be generated from the time list, not need to store ...
    (microsoft.public.dotnet.languages.vb)