Category Archives: TypeMock

Does iterating through SPList.Items using foreach affect performance?

Iterating through SPList.Items using a for (int i) loop is bad for performance, as each call to SPList.Items causes a trip to the DB and will retrieve all items. See http://blog.dynatrace.com/2009/01/11/the-wrong-way-to-iterate-through-sharepoint-splist-items/. I have always wondered whether using a foreach loop … Continue reading

Posted in SharePoint, TypeMock | Leave a comment