By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,069 Members | 1,249 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,069 IT Pros & Developers. It's quick & easy.

What does this mean?

P: n/a
Hi,

Would someone explain the following code more details? Why do we use a
Session here?

DataSet NowDS=(DataSet)Session["NowDS"]

Thanks.

Jason
Nov 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Where is "Session" declared? If it is a Web app and the code is in a
WebForm, which derives from System.Web.UI.Page, it may refer to the
Page.Session object, that can hold values for the current web visitor...

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com

"Jason Huang" <Ja************@hotmail.com> escribió en el mensaje
news:uB**************@TK2MSFTNGP15.phx.gbl...
Hi,

Would someone explain the following code more details? Why do we use a
Session here?

DataSet NowDS=(DataSet)Session["NowDS"]

Thanks.

Jason

Nov 17 '05 #2

P: n/a
hi jason,
you might have stored some set of data into session and here you are
retrieving all those values into DataSet....

rgds,
thiru

Nov 17 '05 #3

P: n/a
Translated literally from C#:

Declare a DataSet object reference names NowDS.
Set NowDS to the value in the you Session object named "NowDS".

If the named object does not exist in the session, you will get a null back.
Which means if you use the reference without checking it for null you will
get an exception. The DataSet would have to have been placed in the session
by code that executed earlier in the program. Like on another page. A
session is tied to a specific user too, so it would have to be the same user
and instance for the session to be the same.

BTW: It is not a good programming practice to stuff DataSets (especially
large DataSets) in the session.

Hope this helps...

Frisky

"Jason Huang" <Ja************@hotmail.com> wrote in message
news:uB**************@TK2MSFTNGP15.phx.gbl...
Hi,

Would someone explain the following code more details? Why do we use a
Session here?

DataSet NowDS=(DataSet)Session["NowDS"]

Thanks.

Jason

Nov 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.