Home All Groups Group Topic Archive Search About
Author
22 Dec 2005 11:53 AM
noor
hi,
how can i no if a perticular session veriable exist or not for example i
want to chek if
Session["myName"] exist or not i f its not then i have ot create it
Session.add("myName","xyz").

at this time i 'm facing this issue actually i want ot safe a dataTable in a
session veriable if it not exist.
kindly help me out.
thanks

regards
Noorali chagani

Author
21 Dec 2005 11:02 PM
Mark Micallef
Try checking to see whether its null. For example:

if( Session["myName"] == null ) {
  Session.Add("myName", "xyz") ;
}

Cheers,
Mark

noor wrote:

Show quoteHide quote
>hi,
>how can i no if a perticular session veriable exist or not for example i
>want to chek if
>Session["myName"] exist or not i f its not then i have ot create it
>Session.add("myName","xyz").
>
>at this time i 'm facing this issue actually i want ot safe a dataTable in a
>session veriable if it not exist.
>kindly help me out.
>thanks
>
>regards
>Noorali chagani
>
>

>
Are all your drivers up to date? click for free checkup

Author
21 Dec 2005 11:20 PM
Jim Cheshire
noor wrote:
>
> at this time i 'm facing this issue actually i want ot safe a
> dataTable in a session veriable if it not exist.
> kindly help me out.
> thanks
>

Keep in mind that DataTables can get relatively large quite easily and
storing them in Session may be problematic under load. Make sure that you
have code that prevents large result sets from being returned from database
queries.

--
Jim Cheshire
================================
Blog: http://blogs.msdn.com/jamesche

Bookmark and Share