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
Jquery Easy Slider Show Next Slide
Windows 7 64 bit Error Lockup Last Ideas
Integrating projects
I recieved an email from someone: how can i see from server who sent it?
Terminal Server client side CD/DVD writing
Create folder / Start Menu Programs Shortcut / Set permissions
ASP.NET unable to cast object of type
cd business card
manage multiple sites from one admin panel drupal/joomla
Coldfusion -SQL and LIKE question