Consider the following methods. I am getting exception as asked , while repeater binding.
Bindrepeater:
private void BindRepeater()
{
var idx =
You may want to persist your results as a collection, not an IQueryable
.
var list = result.ToArray();
itemcount = list.Length;
return list.Skip(skip).Take(10);
The above code may not be correct for paging. You likely will have to run the query twice.
When you assign itemcount
you are executing the query the first time. Why do you need this?
My suggestion would be not to retrieve the item count there and just
return result.Skip(skip).Take(10).ToList();
Basically you can't have both, fetch only the results you need and retrieve the total count in one query. You could use two seperate querys though.