473,394 Members | 1,916 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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.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
5 4993

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
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
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
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

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Bart Plessers \(artabel\) | last post by:
Hello, My script builds a list of files in a folder. These files are stored in an 2-dimensional array, called "a_files". To speed up the script, I don't want the filelist everytime being read...
3
by: Neil Jarman | last post by:
Hi, I need to create an array with a session variable. According to thebook I'm using, the following should work, but if fails: for each key in request.QueryString if left(key,6) = "cboRun"...
4
by: mechweb | last post by:
Hi all, I can successfully store an array in a session variable like so: string arr1 = new string; Session = arr1; But, when I try to display the elements (using the code below) on another...
3
by: Tillman Erb | last post by:
Let's assume a database with a parent table and a child table in a one-to-many relationship, respectively. I have a DataList control on page P that displays values from the parent table. Each row...
0
by: JLSSCH | last post by:
I am having trouble retrieving the value of a Session variable that ha a string array (the same problem occurs if I use a numeric array stored in it when I redirect from one page to another. The...
4
by: MrBiggles | last post by:
Here's the sitch: I read in a csv file with 60000 lines (20 fields per record), and store the data to a local array. The file is read in and stored just fine and pretty quick. Now, if I try to...
5
by: TRB_NV | last post by:
I'm losing information from my Session when I change pages or start the same page over again. I simplified the code so the example is really clear. The sample code that follows is supposed to...
6
by: Vyoma | last post by:
This is quite a bit of problem I am facing, and I cannot point exactly where I am going wrong. I have been lurking around at several forums with regard to login and user authentication scripts and...
4
by: Don Miller | last post by:
I am using a Session variable to hold a class object between ASP.NET pages (in VB). In my constructor I check to see if the Session variable exists, and if it doesn't, I create one and populate it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.