ASP NET MVC Error In Funcion
- by rah.deex
hello it's me again...
thx b4 to experts who have provided solutions to my question..
now i've got some trouble again, would you please halp me...
this is my code (i've got this sample from the internet n i try to modify it) :)
private void FillGridData()
{
//IQueryable<SVC> query = _customerService.GetQueryable();
_dataContext = new dbServiceModelDataContext();
var query = from m in _dataContext.SVCs
select m;
query = AddQuerySearchCriteria(query, _grid.SearchForm);
int totalRows = query.Count();
_grid.Pager.Init(totalRows);
if (totalRows == 0)
{
_grid.Data = new List<SVC>();
return;
}
query = AddQuerySorting(query, _grid.Sorter);
query = AddQueryPaging(query, _grid.Pager);
List<SVC> customers = query.ToList(); //***ERROR IN HERE***//
_grid.Data = customers;
}
the error says "Cannot order by type 'System.Object'.", what is the matter?
do you have solution for me, please...