Hot answers tagged

3

Using SPList.Items property is bad practice. Each time the property is accessed, it requests all items with all fields from database. Instead you should always use SPList.GetItems(). SPList.GetItems(params string[]) - you can use it to load only the fields that you need. As far as I remember it'll only return items in the root folder of the list. SPList....


1

May be users can only edit their own items. There is a setting somewhere ( see for example here: http://stackoverflow.com/questions/26510951/sharepoint-2013-list-users-only-view-their-own-items )


1

If it is just a case to get all items than I always use DataTable to get allitems using below code & do the operations. static void Main(string[] args) { try { SPWeb oWebsite = SPContext.Current.Web; SPList oList = oWebsite.Lists["Employees"]; SPListItemCollection collListItems = oList.GetItems(); DataTable dt = ...



Only top voted, non community-wiki answers of a minimum length are eligible