Hi All,
I try to format date dd-MM-yy in linq to sql query using statement Convert.ToDateTime(E.wodate).ToString("dd-MM-yy") ,but it produces an error
Method 'System.String ToString(System.String)' has no supported translation to SQL.
Here is the code
var workorder = from E in db.qryWOs
where E.wodate >= DateTime.Parse(sTGL1) && E.wodate <= DateTime.Parse(sTGL2)
select new
{ E.wono,
wodatez = Convert.ToDateTime(E.wodate).ToString("dd-MM-yy"),
E.vesselname, E.picname, E.statusdesc, E.workplace, E.workedby,
E.wotitle, E.problem, E.rootcause, E.correctiveaction, E.wotypedesc, E.delay, E.closingdate,
E.reference, E.verifiedbynm, E.closebynm, E.workduration, E.lastupdat ...
Go to the complete details ...