Re: Nullable Convert ? : operand problem
- From: Marc Gravell <marc.gravell@xxxxxxxxx>
- Date: Wed, 5 Dec 2007 02:07:07 -0800 (PST)
As far as the ternary is concerned, it's two values are incompatible,
since "null" is interpreted as a null object, not the int? missing
value. You can re-educate it with a cast:
int? intVar = decVar == null ? (int?) null :
Convert.ToInt32(decVar.GetValueOrDefault());
Marc
.
- Follow-Ups:
- Re: Nullable Convert ? : operand problem
- From: Ben Voigt [C++ MVP]
- Re: Nullable Convert ? : operand problem
- From: mihkeltt
- Re: Nullable Convert ? : operand problem
- Prev by Date: Re: Building my own class library framework
- Next by Date: Re: Nullable Convert ? : operand problem
- Previous by thread: confused listview items during itemChecked Event
- Next by thread: Re: Nullable Convert ? : operand problem
- Index(es):
Relevant Pages
|