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
GP folder redirection. cant turn off
SQL Query Help
Foxpro and using Excel 2010 as an object
HTML - SQL - Carrying Form Variables from Page to Page
Slipstream Windows XP Post SP3 Hotfixes and Updates
ESXi compatible hardware
Exchange 2007 - Delivery is delayed to these recipients or distribution lists:
GFI 2010 Limits exchange 2003 incoming email 2 mb! ARGH!
Multiple counts on 1 column
publishing websites in TMG 2010