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
Thumbnail Photo on Exchange 2007
Designing Luns and datastores
How to configure two types of update timings for VSE 8.7i via EPO server?
Vista DLLHOST.EXE Popup
What is the Best Digital Camera, that is tiny, takes video and takes great pictures?
css positioning for image caption - image height changes but container is absolute
SSAS 2008 MDX All Member Before Current Member
Vlookup Excel 2007
Anyone get Quickbooks errors in the Windows App log but not the program? Intuit says normal
Windows 2008 Server Domain isues