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
Resetting a 3600 Cisco Router to Factory Defaults
New ESXi install fails (PSOD)
Joomla Re-install
Perl, Using Text::CSV_XS / Count number of references
SBS 2k3 unable to relay mails
Delphi, forms in Dll and Threads
Windows Server 2008 R2 iSCSI Initiator and HP D2D CHAP issue
Where does RHEL5 get update & packages from?
Out-bound Call Center Setup!!!!
Migrate from cPanel to Plesk