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
T-SQL Children of Parent Record
Moving WordPress Site - Page Not Found
Sorry, VMware GO doesn't currently support ESXi servers with multiple datastores.
TSQL nested WHILE EXISTS
SQLCommandBuilder - GetUpdateCommand, GetInsertCommand and GetDeleteCommand Questions
IPv4 vs IPv6
Raid 1 mirror Bad block discovered
Unix Perl or Shell script to split a data file by header+trailer
Delete blank line from textarea
Current Logged In User