title: error:LINQ to Entities does not recognize the method
body: <p>i am trying to build a jqgrid. the server code is returning an error?:</p>
  
  <p>LINQ to Entities does not recognize the method 'System.String ToString()' method, and this method cannot be translated into a store expression.</p>
  
  <p>code:</p>
  
  <pre><code>public ActionResult GridData(string sidx, string sord, int page, int rows)
  {
  
      ProductsEntities4 db = new ProductsEntities4();
      var jsondata = new {
              total = 1,
              page = 1,
              records = 2,
              rows = (from pr in db.Products
                      select new {
                          i = pr.Id,
                          cell = new string[] { pr.Id.ToString(), pr.ProductName }
                      }).ToArray()
              };
  
      //return jsondata;
      return Json(jsondata, JsonRequestBehavior.AllowGet);
  }
  </code></pre>
  
  <p>where</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  jQuery(document).ready(function () {
      jQuery("#list").jqGrid({
          url: '/Home/GridData/',
          datatype: 'json',
          mtype: 'GET',
          colNames: ['Id', 'ProductName'],
          colModel: [
        { name: 'Id', index: 'Id', width: 40, align: 'left' },
        { name: 'ProductName', index: 'ProductName', width: 40, align: 'left' }],
          pager: jQuery('#pager'),
          rowNum: 10,
          rowList: [5, 10, 20, 50],
          sortname: 'Id',
          sortorder: "desc",
          viewrecords: true,
          imgpath: '/scripts/themes/coffee/images',
          caption: 'My first grid'
      });
  }); 
  </code></pre>
  
  <p></p>