LINQ to Entity Framework 4.0. SQL Server.
I\'m trying to return a list of objects and one of the columns in the database is varchar(255) and contains dates. I\'m tryin
You want DateTime.Parse(c.value) which will take a string containing a date and create a DateTime object out of it.
The answer is it's not currently possible with Entity Framework. With LINQ itself it is, just not supported with Entity Framework.
read, And the best bet would be using your result and then Converting to date time. Like below,
static void Main(string[] args)
{
Console.WriteLine(getme());
Console.ReadLine();
}
private static DateTime getme()
{
List<string> ss = new List<string>();
ss.Add("11/11/2010");
var r = from l in ss
select new { date = Convert.ToDateTime(l) };
return r.FirstOrDefault().date;
}
you can do like this Date=DateTime.Parse(text)