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

Error while binding Kendo ui Grid using Stored Procedure

3 Answers 88 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Manikandan
Top achievements
Rank 1
Manikandan asked on 03 Jun 2014, 11:59 AM
Hi Team,

I am unable to bind Kendo ui grid from stored procedure using entity framework and I am able to bind kendo ui from table using entity framework.
PFB Code for bind

from table:
return tsmsent.TSMSDets
              .OrderBy(tsms => tsms.Task)
              .Select(tsms => new TimeSheetDetails
              {
                  Task = tsms.Task,
                  Day1 = tsms.Day1,
                  Day2 = tsms.Day2,
                  Day3 = tsms.Day3,
                  Day4 = tsms.Day4,
                  Day5 = tsms.Day5,
                  Day6 = tsms.Day6,
                  Day7 = tsms.Day7
              }).ToDataSourceResult(request.Take, request.Skip, request.Sort, request.Filter);

From Stored procedure:
return tsmsent.GetTimeSheet()
    .OrderBy(tsms => tsms.Task)
    .Select(tsms => new TimeSheetDetails
    {
        Task = tsms.Task,
        Day1 = tsms.Day1,
        Day2 = tsms.Day2,
        Day3 = tsms.Day3,
        Day4 = tsms.Day4,
        Day5 = tsms.Day5,
        Day6 = tsms.Day6,
        Day7 = tsms.Day7
    })
    .AsQueryable().ToDataSourceResult(request.Take, request.Skip, request.Sort, request.Filter);


kindly help me how to get this done using stored procedure.
thanks for advance.

Regards,
Mani

3 Answers, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 05 Jun 2014, 09:45 AM
Hello Mani,

I would recommend checking this Code Library project, where similar scenario is illustrated.

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
rj
Top achievements
Rank 1
answered on 09 Sep 2016, 01:17 PM

i am binding kendo grid using ajax way using stored procedure. first time it will display results properly. but when i am clicking on next page or sorting i am getting below error

Query cannot be enumerated more than once.can you help me

regards,

0
Genady Sergeev
Telerik team
answered on 13 Sep 2016, 02:25 PM
Hi Rajeshwari,

In order to have the grid working with paging in AJAX binding you have to follow the approach shown in the following demo. If this grid still fails please verify that applying Skip and Take functions to the IQueryable instance of your model is working.

Regards,
Genady Sergeev
Telerik by Progress
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
Tags
Grid
Asked by
Manikandan
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
rj
Top achievements
Rank 1
Genady Sergeev
Telerik team
Share this question
or