I am trying to concatenate two dates but when one date is null do not add Default date, leave blank C#. I am trying the code below but is not working
if ((DateTime.TryParse(val, out sDate)) && (DateTime.TryParse(val2, out dDateNew)))
pLabel = sDate.ToShortDateString() + Environment.NewLine + dDateNew.ToShortDateString();
else
pLabel = string.Empty;
if any of the Dates are null just leave it blank. I am getting default date of 01/01/01 with the code above. Any help will be appreciated.
Go to the complete details ...