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
Office 2003 - dollar sign shows up as an arrow
Polycom ViewStation EX Network setup
Using System.Type in switch()
jquery validator and asp.net updatepanel
how can i get a list of client inbox rules through powershell
Dot Net IL Code to C# conversion
usercontrols, docking and scrolling problems
Limiting User Access
Refining an algebra formula
Boot Acer Ferrari 1200 laptop from dvd to upgrade vista to windows 7