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

[Solved] Binding MVC grid to stored procedure with large amount of data

0 Answers 26 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Mohamed
Top achievements
Rank 2
Mohamed asked on 21 Apr 2013, 03:43 PM
Binding MVC grid to stored procedure with large amount of data:
=========================================================

I want to bind MVC grid to an object result that returned from SP

Normally the grid request only data needed to be shown to the user and that will be very good when binding to a table with large amount of data that lets the grid fast and its performance would be good.

i have 2 ways to bind MVC grid with SP:
1) Bind to SP without using .ToList() it gives me an error "The result of a query can not be enumerated more than once."

2) Bind to sp using .ToList() will resolve that error but it will loads all records from database first and the performance will be bad and the grid loading, paging, sorting and filtering would be very slow.

Please tell me a solution to bind MVC grid with SP that returns large amount of data with good performance.

Thank you
Tags
Grid
Asked by
Mohamed
Top achievements
Rank 2
Share this question
or