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
helpdesk interview for bank
What technique is being used here?
setup Xsan with couple of Apple macs final cut pro
OOP, classes, accessor/mutator question (newbie)
Force Outlook 2003 to use encryption connection to Exchange
Difference between using file sharing under a Home Network and a Work Network????
How to create store procedures and pass values in SQL
Single Sign on for RemoteAPPs in Windows 2008 R2 terminal server
Setting msExchMailboxSecurityDescr
iptor with VB.NET
How to parse XML string in Oracle procedure ?