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
make open DNS non-editable
strange error
Cast Question for Crystal Reports
Emc Networker mminfo command
How do I clear memory on an HP LaserJet M2727nf
Old address/mapping cached in Outlook clients
Check to see if a table has a certain value, MS Access 2003
Cannot install programs as Administrator in Windows 7
Outlook not attack shortcut (lnk) attach directly the file
Oracle Packages