I want to do a query with Lambda expression to get values where result set is between a certain range. The value type string in the database and is used to store date values. In SQL the between operator works with this values but not with Lambda expression. I have used this question here for guidance.
Code:
IQueryable<BankmedStatments> q = db.BankmedStatments.Where(u => DateTime.Parse(u.fServiceDate) >= DateTime.Parse(newStartDate));
Error:
LINQ to Entities does not recognize the method 'System.DateTime Parse(System.String)' method, and this method cannot be translated into a store expression.
What am I missing here?