I have the linq query below binding to a Gridview:
gvEvents.DataSource = dc.demand.Select(s => new
{
id = s.id,
user = s.user.name,
protocol = s.events.protocol,
type_demand = s.type_demand,
description = s.description,
comment = s.comment,
date_created = s.date_created
})
.ToList();
gvEvents.DataBind();
I need to convert date_created field to a datatime string like "dd/MM/yyyy hh:mm" .
And I have to say that date_created is a nullable type in the db.
So I need to do something like: date_created = Convert.ToDateTime(s.date_created).ToString("dd/MM/yyyy hh:mm").
But as LINQ doesn't recognize Convert.DateTime and neither .ToString, i'm here to ask how can I do that.
Thanks in advance!