Hi,
Im using the datagrid URL Adaptor as datasource, however following the example provided, it first retrieved ALL rows of data
public
ActionResult DataSource(Syncfusion.JavaScript.DataManager dm)
{
IEnumerable Data = OrderRepository.GetAllRecords();
Syncfusion.JavaScript.DataSources.DataOperations operation =
new
Syncfusion.JavaScript.DataSources.DataOperations();
if
(dm.Sorted !=
null
&& dm.Sorted.Count > 0)
{
Data = operation.PerformSorting(Data, dm.Sorted);
}
if
(dm.Where !=
null
&& dm.Where.Count > 0)
{
Data = operation.PerformWhereFilter(Data, dm.Where, dm.Where[0].Operator);
}
int
count=Data.AsQueryable().Count();
if
(dm.Skip != 0)
{
Data = operation.PerformSkip(Data, dm.Skip);
}
if
(dm.Take != 0)
{
Data = operation.PerformTake(Data, dm.Take);
}
return
Json(
new
{ result = Data, count = count }, JsonRequestBehavior.AllowGet);
}
I found this to be inefficient since when the data gets too large it takes seconds to retrieve the data
is there anyway to perform the data manipulation without having to retrieve the entire dataset?
I tried using IQueryable<T> as the data but this returns error
There is already an open DataReader associated with this Connection which must be closed first.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: MySql.Data.MySqlClient.MySqlException: There is already an open DataReader associated with this Connection which must be closed first.