Nullable DateTime in .NET 2.0

Posted on May 24, 2007. Filed under: Uncategorized |

Thanks to generics in 2.0, now any value type can be NULL.

    public class DateTimeNullTest
private Nullable<DateTime> oDate = new Nullable<DateTime>(DateTime.Now);

public DateTimeNullTest()
// Yay - It doesn't blow up!
if (oDate != null)
oDate = null;


AddThis Social Bookmark Button var addthis_pub = ‘alashcraft’;

Technorati tags: , , , ,

Make a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

  • About Me

    My name is Alvin Ashcraft. I am a geek, daddy and husband. I have 12 years of software development experience in the healthcare and manufacturing industries using Microsoft technologies.
  • Flickr Photos

    Luci going for an afternoon drive.


    Anna opening gifts with her sleepy sisters before school this morning.

    More Photos

Liked it here?
Why not try sites on the blogroll...

%d bloggers like this: