473,468 Members | 1,303 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Quick question

Hi

In a session key add such as:

Session.Add("CustId", userId);

if i then called that again so say i did this

Session.Add("CustId", userId);

Session.Add("CustId", userId);

Would it overwrite the first one with the valaue of the second one, or does
it somehow add the session variable twice? If it does add it twice how do i
make it overwrite the old one if the old one doesnt exist already and if it
does. Thanks.
Mar 28 '07 #1
4 2150
Overwrite.

--
~~~~~~~~~~~
Ben Rush
http://www.ben-rush.net/blog
"PokerMan" <no****@pokercat.co.ukwrote in message
news:ea*************@TK2MSFTNGP05.phx.gbl...
Hi

In a session key add such as:

Session.Add("CustId", userId);

if i then called that again so say i did this

Session.Add("CustId", userId);

Session.Add("CustId", userId);

Would it overwrite the first one with the valaue of the second one, or
does it somehow add the session variable twice? If it does add it twice
how do i make it overwrite the old one if the old one doesnt exist already
and if it does. Thanks.


Mar 28 '07 #2
On Mar 28, 4:47 pm, "PokerMan" <nos...@pokercat.co.ukwrote:
Hi

In a session key add such as:

Session.Add("CustId", userId);
Also this syntax in in general terms slightly more sexy:
Session["x"] = someVariable;

....

--
http://ajaxwidgets.com
ASP.NET 2.0 Ajax Widgets

Mar 28 '07 #3
Yes, in this case it would overwrite the previous value.

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"PokerMan" <no****@pokercat.co.ukwrote in message
news:ea*************@TK2MSFTNGP05.phx.gbl...
Hi

In a session key add such as:

Session.Add("CustId", userId);

if i then called that again so say i did this

Session.Add("CustId", userId);

Session.Add("CustId", userId);

Would it overwrite the first one with the valaue of the second one, or
does it somehow add the session variable twice? If it does add it twice
how do i make it overwrite the old one if the old one doesnt exist already
and if it does. Thanks.

Mar 28 '07 #4
much love to you guys, thought so, thanks!
"PokerMan" <no****@pokercat.co.ukwrote in message
news:ea*************@TK2MSFTNGP05.phx.gbl...
Hi

In a session key add such as:

Session.Add("CustId", userId);

if i then called that again so say i did this

Session.Add("CustId", userId);

Session.Add("CustId", userId);

Would it overwrite the first one with the valaue of the second one, or
does it somehow add the session variable twice? If it does add it twice
how do i make it overwrite the old one if the old one doesnt exist already
and if it does. Thanks.


Mar 28 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
1
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.