I am getting the following exception:
LINQ to Entities does not recognize the method ‘Int64 ToInt64(System.String)’ method, and this method cannot be translated into a store expression.
I had long.Parse(ProjectID.ToString()) and I see the suggestion was to use Convert.ToInt64 but I am still getting the same exception
string projID = ProjectFileID.ToString();
var d = (from f in context.FileInfo
where f.ID == Convert.ToInt64(projID)
select (f));
Just do the conversion outside the query, so you compare the results directly to a variable of type
long:Also, given that you’re calling
ToString()onProjectFileID, can you maybe just cast it instead, since it certainly seems like it’s anintor something along those lines.