[RESOLVED] [2.0] nullable modifier?? when do we need them??
nullable modifier ...when actually can be helpful? Posted on: 08/12/2006 18:35:35
I came across in a book I was reading, since we can't assign a null/nothing value to a value type variable,
we can use nullable modifier to assign a null value.
My question is, in the real world, how can this C# 2.0 feature be helpful???
any one has used this ??
thanks
regards
nath
Re: [2.0] nullable modifier?? when do we need them??
Let's say that you have a field for the date that someone was married. If the person has never been married then that field should be null, but a DateTime variable cannot be null because it is a value type. A Nullable<DateTime> steps in and allows you to use a single variable for either null or an actual date.
Re: [2.0] nullable modifier?? when do we need them??