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
what is the default directory to run jsp file from tomcat 5.5 and what directory for mysql_connector.jar file to be placed?
asp - The resource could not be found
DD-WRT USB HARD DISK Network Sharing on windows & linux box
Remove header from array created using Get-QADComputer cmdlet?
Dynamically passing the parameter the service constructor (without configuration file)
2nd DNS Entry for Exchange Client Access Server
infopath regular expressions
UltraTree and Filtering ?
Can't access Microsoft windows update website anymore?
CA etrust Threat Management