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 can i capture screen using C# window application ??
Reset display resolution windows 7
Windows Server 2003 Logon/Logoff Log Report
ISA PPTP VPN connection not working
how can I read more then one cell an excel file in vb.net
PHP error
"svc: short len 19, dropping request"
RHEL command to eject cd rom
port 443 closed
Configuration for QNAP TS-410U after reset