Re: 2 dimension arrays
Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance
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? ... as you have a *reference* to this array, there is really only one array ... >> Andrew wrote: ... (microsoft.public.dotnet.framework.aspnet) - RE: Session variables and reference
... Session variable that is an array of a class I created: ... public cut//copy constructor ... Kmax = myCut.Kmax; ... I realized that when I set my temporary array to equal the session array, ... (microsoft.public.dotnet.framework.aspnet) - Re: help with array within another array
... you could make a hash with reference to hash values: ... it seems like you might want to consider using the node identifier as the first key in %SESSION, and make the value a reference to hash keyed by the owner and severity: ... I am trying to declare two associative array ... (perl.beginners) - Re: [PHP] SESSION problem
... But, if you came from a background that predated associate arrays, then using numeric indexes would seem more natural. ... looked into the session extension in that level of detail, but I doubt such a limitation would exist if there was not a very good reason for it. ... Given that I can't see into the future, even if I currently only have one set of data to store in the session I wouldn't just chuck the bits of paper from the file into the filing cabinet. ... The root level of the session array should contain descriptive keys, and I've never been in a situation where 5318008 is descriptive and gives context to the data unless you turn it upside down! ... (php.general) - Re: Keeping an Array in Memory
... Andrew wrote: ... > reloaded each time a .php script is run. ... I could load the array from a file ... > stay in memory until the server is shutdown ... (comp.lang.php) |
|