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
New mail user not showing up in GAL.
Move applications between networked computers
Terminal server 2008 R2 Pinned Taskbar Links
cisco softphone registration
Two GIG Nics in my HP workstation how do I set them up to load balance?
How to set the backcolor of the entire gridview rows quickly +vb.net 2005
get latest file in the directory in unix
C++ Serial Communication - LSB & MSB
Coookie not storing information
Calender applications.....