473,387 Members | 1,766 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,387 software developers and data experts.

object in session question

JJ
Hi,

I assigned a class to a session and after its use during the session I
want to null it out of the session or reset it by killing the object in the
session and creating a new one. Any ideas on how to do this? What's the best
method to do this?

Thanks,

JJ
Nov 19 '05 #1
3 804
the garbage collection should do it automatically. If its in the Session
object it will "go away" when the session terminates

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"JJ" <JJ@discussions.microsoft.com> wrote in message
news:89**********************************@microsof t.com...
Hi,

I assigned a class to a session and after its use during the session I
want to null it out of the session or reset it by killing the object in
the
session and creating a new one. Any ideas on how to do this? What's the
best
method to do this?

Thanks,

JJ

Nov 19 '05 #2
Hi,

Call the Remove method of the HttpSessionState class to remove the item from
Session, and then dispose it.

regards'
Joyjit

"JJ" <JJ@discussions.microsoft.com> wrote in message
news:89**********************************@microsof t.com...
Hi,

I assigned a class to a session and after its use during the session I
want to null it out of the session or reset it by killing the object in the session and creating a new one. Any ideas on how to do this? What's the best method to do this?

Thanks,

JJ

Nov 19 '05 #3
Okay, you want to "start a new one," which means you want to replace the
current instance with another instance, correct? If so, just assign the new
instance to the Session variable. Once this is done, the old instance has no
references, and Garbage Collection will clean it up.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"JJ" <JJ@discussions.microsoft.com> wrote in message
news:89**********************************@microsof t.com...
Hi,

I assigned a class to a session and after its use during the session I
want to null it out of the session or reset it by killing the object in
the
session and creating a new one. Any ideas on how to do this? What's the
best
method to do this?

Thanks,

JJ

Nov 19 '05 #4

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

Similar topics

3
by: VijayShankar | last post by:
Can u be more specific on your question Anyway its not like Session variables are available for sometime and not available for sometime. When your session starts it is very much available...
26
by: Alan Silver | last post by:
Hello, I have a server running Windows Server 2003, on which two of the web sites use the MegaBBS ASP forum software. Both sites suddenly developed the same error, which seems to be connected to...
2
by: Colin Basterfield | last post by:
Hi, I am confused... I have the following code in my Page_Load method private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here
7
by: Nikhil Patel | last post by:
Hi all, I am using a Session object in my ASP.Net application to store a value of a Database field. I can access it as ... int iProposalId = Session; The session timeout is set to 20. Now my...
4
by: Tony | last post by:
how do I check if the data in the session object is null before extracting it. The following throws an error if the Session object has not already been created. string str =...
2
by: Markus Prediger | last post by:
Hi NG, I have an asp.net project that uses an vb6 com object for some database-manipulation (I cannot rewrite it in .net, sorry, its not my decision). I want it to be instanciated seperately...
3
by: MrShovel | last post by:
I'm new to this ASP.NET caper and have the following questions. I have a TestObject that contains about 50 fields of data and 3 member procedures. Below is a simplified explanation of what I do....
13
by: | last post by:
Simple question, I think... I'm storing an object in the Session object. In the code behind I read that object: trx = CType(Session("Transaction"), BOCSTransaction) If I change any...
12
by: Anthony Jones | last post by:
Here's a question that I've not been able to get a definitive answer to. Creating an STA object (such as a typical VB6 object) and assigning to the ASP Session store is a bad thing. It's a bad...
5
by: jamie.jamazon | last post by:
I'm currently developing a small MVC framework using classic ASP (don't ask me why!) At it's core it calls the controller script which does the heavy logic and builds disconnected recordsets of the...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
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...

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.