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
Upgrading graphic card ATI Radeon X1650 Pro (RV530)
How to configure Remote SPAN or alternative option on HP Procurve 2626-PWR switch ?
How to Backup Ubuntu Server 8.10
How to Installing SQL-DMO on sql 2008
Fast download/upload, slow surfing
htaccess modrewrite Urls
Shared calendar does not show appointments until refreshed
How to find CD Burning folder path in c# and operating system as a XP?
printmig.exe aborting early
PowerShell string += question