May 2011 Entries

MVC3 JSON Error

I was working on a MVC3 project with jqGrid using JSON. The data was created using EF4 Code First. Took me a while to hook up the grid and actually having it post back to the server to retrieve the JSON. I was having issues with my int ID column not formatting to JSON. LINQ to Entities does not recognize the method 'System.String ToString()' method, and this method cannot be translated into a store expression. StackOverflow had some responses to use SqlFunctions.StringConvert(... ......