4
Reply

How to Declare Null value in Datetime

sai vital

sai vital

Jun 25 2016 1:43 AM
333
if (date2 == "")
{
date2 = null;
}
DateTime dates2 = DateTime.ParseExact(date2, "dd-MM-yyyy H:mm", CultureInfo.InvariantCulture);
by using this code i got an Error 'String reference not set to an instance of a String.'. 

Answers (4)