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
Win 2003 server dns
How to install fonts for my website?
Will there be a 13" Macbook with an iCore processor anytime soon? Safe to buy C2D?
Getting the row number of a record
RSH client for windows 2008 r2
Blackberry Enterprise Express on Exchange 2007 Can't resolve name during MAPI Profile Setup
How do I print to a CString?
Stringtopostnet function not working in Crystal viewer 2008 ---
Oracle Error "To many precesion Specifiers"
PHP, ASP, Moneris