Hi
I have below code but ut is giving above error
C#
var LastSessionDate = (from t in context.View_Details
where t.IsActive == true && t.GroupID == colum.GroupID
select t.SessionDate).FirstOrDefault();
SessionDt = SessionDt + LastSessionDate.ToString("dd-MM-yyyy") + " ," ;Thanks

Jignesh KumarRank #91 · 22.9K reputationPosted Jun 14, 2023, 2:57 AM EDT
use this one,
var LastSessionDate = (from t in context.View_Details where t.IsActive == true && t.GroupID == colum.GroupID select t.SessionDate).FirstOrDefault(); SessionDt = SessionDt + LastSessionDate.Value.ToString("dd-MM-yyyy") + " ," ;