How to assign null value to a datetime object [Resolved]

Posted by S.faizaan under VB.NET on 7/18/2011 | Points: 10 | Views : 2389 | Status : [Member] | Replies : 2
Hello, can anyone explain me how to assign a null value to a datetime object.
Thanks in advance

Thanks & Regards,
Faizaan



Responses

Posted by: Sushilkumar.sush on: 7/18/2011 [Member] Starter | Points: 50

Up
0
Down

Resolved
Hi,
You can use Nullable Types to achieve that.


DateTime? dateSample;
dateSample.Value = null;

//or

Nullable<DateTime> dateSample2;
dateSample2.Value = null;

If u want this in VB.Net Just use convertor like C# to VB.net
Hope this will help You.

Sushilkumar Shinde

S.faizaan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: S.faizaan on: 7/18/2011 [Member] Starter | Points: 25

Up
0
Down
Thank you

Thanks & Regards,
Faizaan

S.faizaan, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response