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
Activesync through UAG
Excel Interop: Find cell by name
web site name instead of file: uri
IE error only, object doesn't support this property or method
ASA 5505 DMZ won't Access Internet
SSIS Data extract from oracle to sql server
Cloud Computing
How to open old tethereal pcap files?
Script to change CD-Rom drive letter
SharePoint styling broken after migration (Urgent, Screenshots attached)