Hi
In a repeater it is displaying Date as - 01-01-0001. I want if Date is null / blank it should be displayed as ""
htmlTable.Append("
Thanks
Hi
In a repeater it is displaying Date as - 01-01-0001. I want if Date is null / blank it should be displayed as ""
htmlTable.Append("
Thanks
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Naimish MakwanaRank #324 · 7.7K reputationPosted Apr 19, 2023, 5:25 AM EDT
Try this:
htmlTable.Append("" + (column.GrpSessionStartDate != null ? Convert.ToDateTime(column.GrpSessionStartDate).ToString("dd-MM-yyyy") : "") + "");Thanks
Amit MohantyRank #112 · 20K reputationPosted Apr 19, 2023, 5:04 AM EDT
Try this
htmlTable.Append("" + (String.IsNullOrEmpty(colum.GrpSessionStartDate) ? "" : Convert.ToDateTime(colum.GrpSessionStartDate).ToString("dd-MM-yyyy")) + "");Ramco RamcoRank #462 · 5.4K reputationPosted Apr 19, 2023, 5:19 AM EDT
Hi Amit
It is giving error Cannot convert from system.date.time? to string
Thanks