473,406 Members | 2,356 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,406 software developers and data experts.

Session string error?

Hi Newsgroupies,

Anyone know why this fails In WebForms?

Session.Add("fExample", double.NaN);

double fExample = (double)Session["fExample"];

if(fExample == double.NaN)
{
// The program does not come in here (as expected)

...
}
else
{
// The program comes in here instead (not as expected)

...
}

Anyone suggest any solutions/workarounds?

Thanks in advance,

Newsgroupie, UK
Nov 16 '05 #1
2 1233
"newsgroupie" <ne*********@nospam.com> wrote:
double fExample = (double)Session["fExample"];
if(fExample == double.NaN)
{
// The program does not come in here (as expected)


Two NaNs are not equal. You need to use Double.IsNaN.

P.
Nov 16 '05 #2
Thanks Paul!

I'm new to C# ;-)

Newsgroupie, UK

In message <co**********@sparta.btinternet.com>, Paul E Collins
<fi******************@CL4.org> writes
"newsgroupie" <ne*********@nospam.com> wrote:
double fExample = (double)Session["fExample"];
if(fExample == double.NaN)
{
// The program does not come in here (as expected)


Two NaNs are not equal. You need to use Double.IsNaN.

P.

Nov 16 '05 #3

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

Similar topics

2
by: Steve Remer | last post by:
OK, I think I understand session state pretty well. I've done additional research on Google over the last few days to fill in any holes. To begin with, I'm using StateServer and not InProc for...
13
by: dee | last post by:
Hi My code complies the following line: Session("passed") = 1 but puts wiggly error line under the second Session("passed") in the following expression: Session("passed") = Session("passed") +...
2
by: Gavin Lyons via .NET 247 | last post by:
Hello, I'm writing a newsletter application which uses backgroundthreading. I'm using Session variable to report on progresswhile it loops through a dataset. The 'Status.aspx' pagerefreshes every...
8
by: Andrew Teece | last post by:
Hope someone can help. We are trying to deploy an ASP.Net 2.0 application to a 3-node webfarm. The application uses the ReportViewer control in local mode, hence we need session state. Because we...
4
by: Cirene | last post by:
In my web.config I added <pages enableSessionState="true">. In each of my pages I also added EnableSessionState="True" to the Page declaration. (I didn't think this was necessary, but...) ...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.