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
Can I use server scripts with iPad?
How to make vba wait for Cube formulas to calculate?
How can I run my PC in safe mode?
Network Diagnostic Tool on CentOS 5.4
I need sample jsp programs using MySQL data base.
well vs borewell
Revert to Visual Studio 2008
Sonicwall rule to block DHCP traffic between two site-to-site
Internet Explorer - Links redirecting to strange sites
Working with Legacy Systems and Users (Database Design)