This is a migrated thread and some comments may be shown as answers.

Timeout when calling ToDataSourceResult

1 Answer 318 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 13 Dec 2012, 06:03 AM
I am receiving a timeout error via an AJAX call when using Kendo with MVC.  The result set is a large set of records approx 250K with 14 fields though I would not expect this to timeout.  Any ideas why this might be happening?
public ActionResult Grid_Read([DataSourceRequest]DataSourceRequest request)
{
    var dbContext= new DataBaseContext();
 
    IQueryable<Report> ReportData = from ParentRecord in ParentTable
                  join ChildRecord in ChildTable on ParentRecord.Id equals ChildRecord.ParentId
                  select new ReportModel
                  {
                      FieldOne = ParentRecord.FieldOne,
                      FieldTwo = ParentRecord.FieldTwo,
                      FieldThree = ChildRecord.FieldThree
                  };
 
    DataSourceResult result = ReportData .ToDataSourceResult(request);
 
    return Json(result);
}

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 15 Dec 2012, 11:19 AM
Hello Michael,

Does the problem occur when returning JSON and the ToDataSourceResult is not used? With 250k records you will probably get an exception for exceeding the maximum JSON length in which case you should either use custom JSON result or paging.

Regards,
Daniel
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Michael
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or