Problem in Changing Date Format in LINQ Select query
-
Hi all, I am trying to change the dateformat in linq select statement.
var query = from t in datacontext.users
select new
{ name = t.firstname +" "+t.lastname,
date = t.dateofjoin.Value.ToString("dd-MMM-yyyy")
};its not throwing any exception at runtime. but i am not getting any records into 'query'. it displays 'No Support Translation in SQL'. please help me. Thanks in advance, sekhar
-
Hi all, I am trying to change the dateformat in linq select statement.
var query = from t in datacontext.users
select new
{ name = t.firstname +" "+t.lastname,
date = t.dateofjoin.Value.ToString("dd-MMM-yyyy")
};its not throwing any exception at runtime. but i am not getting any records into 'query'. it displays 'No Support Translation in SQL'. please help me. Thanks in advance, sekhar
can not be formatted in LINQ because the C# function doesnot be supported. you can format the properties after fetching them.