Reputation: 159
I'm using the following code :
using(var sd=new dataEntities())
{
var listofdata=sd.users.where(d=>d.id.ToString().Contain("2"));// id as int
// error : LINQ to Entities does not recognize the method 'System.String ToString()' method, and this method cannot be translated into a store expression.
}
I looked at the site but did not find answer
Upvotes: 2
Views: 4136
Reputation: 600
You need to use the SQL Function to translate the ToString method.
SqlFunctions.StringConvert((double)id)
Answered Here: Problem with converting int to string in Linq to entities
Upvotes: 7