Link to home
Start Free TrialLog in
Avatar of Silas2
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?
ASKER CERTIFIED SOLUTION
Avatar of naspinski
naspinski
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial