title: Get Large JSON from web API
body: <p>I am using .net Web Api to get data for my data grid. The call is made via ajax call like this</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code> $.ajax({
     type: 'GET',
     dataType: 'json',
     contentType: "application/json; charset=utf-8",
     url: ReportURL, // "api/AppData/InvoiceReport/10"
     success: function (mydata) {
       
       console.log(mydata);
       createReportGrid(myData); // this function creates a KENDO grid
     },                
     error: function (error) {
       alert(error);
     }
   });</code></pre>
  </div>
  </div>
  </p>
  
  <p>The Web API method Looks like this</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>[HttpGet]
  public HttpResponseMessage InvoiceReport(int Id)
  {
    // some llogic of data retrieving
    // objReportDataList is of Type List&lt;vmReport&gt;
    // thisstructure contains a DataTable, and 2 more list type  
   return Request.CreateResponse(HttpStatusCode.OK, objReportDataList);
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>These calls work <strong>perfectly</strong> for Rows Count approx <strong>100K</strong> rows</p>
  
  <p>Web Api serializes perfectly. But when the Row Count exceeds <strong>200K</strong> i get <strong>500 internal server error</strong>
  The stack traces tells "System-OutOfMemoryException-occured-in-mscorlib-dll"</p>
  
  <p><strong>NOTE</strong> - I cant use server pagination to get little data only. This Million rows data is working on a ASP.NET Webforms application. We have migrated to MVC pattern and used WebApi for fetching Data but this error is occuring.
  <strong>PS</strong> - I have tried <strong>many many solutions</strong>, but helpless</p>
  
  <p>Please Guide me to Get this error removed and my reports get going</p>