c# - LINQ to Entities does not recognize the method 'Int32 ToInt32(System.String)' method -


I checked online for some answers, and I understood that I can not translate ToInt32 into T-SQL , And I need to use the running of my query, before the memory and then the conversion, but I do not know how to apply it in my example. I have a query below, and it shows me the error message written in the title:

  string [] parts = rvm.ZipCode.Split ('-'); Var list = result Orterby (B = & gt; Math.bs (Convert .OIT 32 (Part [0]) - Convert.OINIT32 (B.Zip)). Take (5) .Ollist ();   

Where results is another query I applied earlier. How to solve any idea?

You can try to do something like this:

  // It would be better if we change the conversion only once, then each Time we take an item from our collection. Nt value = convert toint32 (parts [0]); var list = results.AsEnumerable (). OderBy (z = & gt; Math.Ebus (value - convert toInt32 (z.Zip)). Take (5 ) .toList ();    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -