Silas2
asked on
Using variable in Linq query
I'm trying to do something like this in Linq To Entities:
string criteria = FuncToCalcCriteria();
“Select * from tablename where SomeField “ + criteria;//could be >< <>= etc.etec.
? I'm getting 'Method cannot be translated into a store expression' if I put the method into the Linq, but I can't concatenate expressions like you do in SQL strings, so is there a way round?
string criteria = FuncToCalcCriteria();
“Select * from tablename where SomeField “ + criteria;//could be >< <>= etc.etec.
? I'm getting 'Method cannot be translated into a store expression' if I put the method into the Linq, but I can't concatenate expressions like you do in SQL strings, so is there a way round?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.