I want to compare string which is date. I am trying following linq query, but I get operators can be applied to operands of type string to string.
var descriptions =
from a in db.Descriptions
where a.ID == 12
&& a.arrivalDate >= "20110101000000"
&& a.arrivalDate <= "20110131000000"
select a;
Any ideas?
You cannot compare a
DateTimevariable with aStringvariable.So you need to create a
DateTimefirst:and the LINQ query: