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
Locking down Exchange in SBS 2003
Starting mysqld from fedora
notepad change is not reflected everywhere
Routing
Function file_get_contents connection time out
changing cell reference
Convert numbers to text
Strip out ’s in mySQL query | XML Parsing Error: undefined entity
Microsoft Office 2007 Clip art disappeared
Pass recordset from local sql server to remote sql server using access adp