You're most likely iterating over a lazy-loaded IEnumerable collection, while doing new data lookups. Fix for this is usually to call .ToList() before enumerating to be sure not to keep the datareader open.
Here is an example of fixing the very same issue https://bitbucket.org/burningice/compositec1contrib/diff/Sorting/Web/UI/SortData.cs?diff2=33ffdfc48891&at=default
Here is an example of fixing the very same issue https://bitbucket.org/burningice/compositec1contrib/diff/Sorting/Web/UI/SortData.cs?diff2=33ffdfc48891&at=default