LINQ to Entities does not recognize the method 'System.DateTime ToDateTime(System.String)' method

前端 未结 4 500
再見小時候
再見小時候 2020-12-15 13:36

I am trying to convert one application to EntityFrameWork codefirst. My present code is

 string sFrom  =\"26/12/2013\";
 select * FROM Trans where  CONVERT(d         


        
4条回答
  •  心在旅途
    2020-12-15 13:55

    Take the convert part out of linq statement and keep it in a variable, like this:

    var xyz = Convert.ToDateTime("12/31/2018");
    

    and use this variable in the linq statement.

提交回复
热议问题