Microsoft
Software
Hardware
Network
Question : Check for nulls to stop the error - Nullable object must have a value
In the line of code below I want to check if nothing is being passed to User.longVal to stop the error
"Nullable object must have a value"
User.longVal = (double)CurrentUser.longVa
l;
So if nothing is in the
(double)CurrentUser.longVa
l
I want to set a default value -
Do I use the ?? directive
Answer : Check for nulls to stop the error - Nullable object must have a value
I believe it should be something like (C# only):
1:
User.longVal = (double)CurrentUser.longVal ?? default_value;
Random Solutions
How do I invoke a Java script for onkeypress for a dynamically added control?
When I encrypt/encode a string using codeigniter encryption class, it is different everytime, why?
How Can I Turn Off the Record Selector Bar on an Inserted SubForm?
Trouble installing Panasonic Printer/Copier devices on SBS 2008
Linq and new features design in VS 2008
Popup details on mouse hover using Jquery
GPO Assign Application reinstall
Windows XP Taskbar won't auto-hide
What are some good guides on designing and building video games
Can anyone guide me how to download MEMO software back to N900 ?