Wednesday, 18 June 2014

How to assign null value to datetime in .net

The fundamental stuff of nullable DateTime. DateTime struct itself does not provide a null option. but we can make it a nullable type which allows you to assign the null to a datetime.


define the datetime variable as nullable:

DateTime? dt = null;
Or
Nullable<datetime> dt

1 comment:

  1. sir, i need urgent help from you. please give me your email id so i can contact you. please sir its really urgent.

    ReplyDelete