Skip to content
Morning Dew by Alvin Ashcraft
  • Home
  • More About Me
  • Privacy Policy

Day: May 24, 2007

Nullable DateTime in .NET 2.0

Posted on May 24, 2007 | by Alvin A.

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: c#, .net, null, generics, pattern
Find me on MySpace and be my friend!

Posted in Uncategorized
Microsoft MVP Program
– My WPF Tips Site
– My WinUI Tips Site
– Learn more about my upcoming book, Learn WinUI 3 from Packt Publishing
– Subscribe to Alvin Ashcraft’s Morning Dew by Email

About Me

I am a Philadelphia-area .NET developer, husband, dad, and geek. I am currently a Principal Software Engineer at Allscripts. I have over 25 years of software development experience in the Healthcare and Manufacturing industries.

More…

May 2007
S M T W T F S
 12345
6789101112
13141516171819
20212223242526
2728293031  
    Jun »

Tags

.net core (676) agile (906) alexa (239) android (604) angular (561) angularjs (257) asp.net (780) asp.net mvc (574) blazor (284) c# (1638) css (514) devops (251) entity framework (389) f# (785) flutter (352) github (273) iOS (223) javascript (2130) jquery (402) microsoft azure (1350) ms teams (286) mvvm (258) powershell (1671) raven db (424) react (303) resharper (281) sharepoint (1238) silverlight (937) sql server (2781) tfs (329) typescript (464) unit testing (220) uwp (525) visual studio (2045) vs2010 (696) vs code (269) windows 8 (417) windows 10 (583) windows azure (556) windows phone (893) windows phone 7 (266) winrt (291) wpf (1510) xamarin (1391) xaml (894)
© 2021 Morning Dew by Alvin Ashcraft | Bootstrap WordPress Theme