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
– My WPF Tips Site
– My WinUI Tips Site
– Get my book, Learn WinUI 3 from Packt Publishing

About Me

I am a Philadelphia-area technical writer, .NET developer, husband, dad, and geek. I currently work for Microsoft and have over 27 years of software development experience in the Healthcare and Manufacturing industries.

More…
The best UWP books of all time

Daily Dew Drop – Email newsletter sign-up




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

Tags

.net core (689) agile (1020) android (704) angular (711) angularjs (258) asp.net (780) asp.net core (397) asp.net mvc (578) aws (291) blazor (504) c# (1930) css (641) devops (348) entity framework (433) f# (869) flutter (503) github (411) javascript (2399) jquery (419) microsoft azure (1671) ms teams (494) mvvm (284) node.js (298) powershell (1845) raven db (468) react (442) resharper (329) sharepoint (1305) silverlight (940) sql server (3084) tfs (331) typescript (587) uwp (557) visual studio (2368) vs2010 (696) vs code (405) windows 8 (418) windows 10 (600) windows azure (556) windows phone (893) windows phone 7 (266) winrt (322) wpf (1566) xamarin (1584) xaml (926)
© 2022 Morning Dew by Alvin Ashcraft | Bootstrap WordPress Theme