c# - Convert sql query into linq getting error in converting date -


my sql query is:

select count(*),convert(varchar, addedon, 101)  membernotifications isactive=1   group convert(varchar, addedon, 101)  order convert(varchar, addedon, 101) desc 

but m not able result, in following attempt

    list<notificationcounts> lst = (from mn in this.membernotifications    mn.uid.equals(friendid)  select new notificationcounts{ notificationdate = mn.addedon.tostring("mm/dd/yyyy") }) .tolist<notificationcounts>(); 

i want list of date in string mat giving exception

linq entities not recognize method 'system.string tostring(system.string)' method, , method cannot translated store expression.

is there solution error?

true... linq can't transform .tostring sql instruction... need plain value of mn.addedon , transform after database get. hope helps


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -