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
Difference between Icefaces,myfaces,richfaces
in JSF?
Coldfusion -SQL and LIKE question
WiFi / wireless connection dropped & laptops need to be rebooted to reconnect to 2Wire broadband modem : Event id 5005
New Windows 7 workstations in existing SBS 2003 domain
ASP.NET unable to cast object of type
Create folder / Start Menu Programs Shortcut / Set permissions
Offline address book cannot be downloaded after moving mailbox to exchange 2010
Anyone used OEM for monitoring PeopleSoft application and peoplesoft databases?
Inkjet printer recommendation for the home wanted
Integrating projects