I got this interview question today, any idea?
Difference between SPList.AllItems.GetItem() or SPLIst.GetItem();
|
I got this interview question today, any idea? Difference between SPList.AllItems.GetItem() or SPLIst.GetItem(); |
||||
|
The So, the following code:
Would generate the following errors:
Additionally, all three references Google has to "SPList.AllItems" point to this question (way to go SE SEO!). I think the possibilities are:
|
|||
|
|
|
Just some small points, in case it was just a mistake and to clarify for anyone new to SharePoint reading this... SPList.GetItems (note the 's') is the main way you would query data, using one of the four available overloads:
AllItems on the other hand is 100% invalid. You would use SPList.Items to get the SPListItemCollection of all items in the list. |
|||
|
|
SPListhas a propertyAllItems, so the first example is invalid? still learning sp though, so not sure if this is the case. – TZHX Jun 8 '12 at 9:49