i wana convert string to int in linq to entities but Convert.ToInt32 and int.Parse can not translate to sql And my database is BIG and can not get all of them to memory (over 60k record and get bigger) my query is something like
int myNumber = 1390;
var result = from dr in myEntitiy.TableX
where (Convert.ToInt32(dr.stringYear) > myNumber) // <== error
select dr;
error say cannot translate convert method
LINQ to Entities does not recognize the method 'Int32 ToInt32(System.String)' method, and this method cannot be translated into a store expression.
whats solution
UPDATE : If there is no way to do this please make me sure about this, then i have to change field type in database but it will be hard :(