I have the following query:
var produto = (from a in context.ItensReceita
join b in context.Receita on a.t0080_id_receita equals b.t0080_id_receita
join c in context.Medicamento on a.t0080_id_receita equals c.t0051_id_medicamento
join d in context.Pessoa on b.t0031_id_paciente equals d.t0031_id_pesso
where b.t0020_id_empresa == idEmpresa
&& Convert.ToDateTime(b.t0080_dt_venda) >= Convert.ToDateTime("2017/01/01")
&& Convert.ToDateTime(b.t0080_dt_venda) <= Convert.ToDateTime("2017/01/31")
select new { b.t0080_dt_venda, d.t0031_nome, c.t0051_nome, a.t0081_lote, a.t0081_qtde, b.t0080_status });
But this error:
LINQ to Entities does not recognize the method 'System.DateTime ToDateTime(System.String)' method, and this method cannot be translated into a store expression.
Not accepting the date conversion, how can I resolve this?