ASP NET MVC Error In Function
        Posted  
        
            by rah.deex
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by rah.deex
        
        
        
        Published on 2010-04-26T04:06:45Z
        Indexed on 
            2010/04/26
            4:23 UTC
        
        
        Read the original article
        Hit count: 372
        
ASP.NET
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...
© Stack Overflow or respective owner