Omicron Llama

Coding all day, every day.

April, 2011

SPList.Items versus the SPQuery

So you’ve embarked on writing a bit of code that must enumerate a SharePoint List’s Items one by one and do some stuff with them. You’ve (at some point) came across the Best Practices page on MSDN on Handling Large Folders and Lists, and seen that using SPList.Items is bad. It’s bad because you could […]

Feature Stapling – The TL;DR Version

In a Site-Scoped Feature, have this line in the Elements.xml:

The Id here is the GUID of a Web-Scoped Feature you want to activate every time a Sub-Web of template STS#0 (Team Site) is created. Simples.

Programmatically Update a Content Type

Here’s a straight forward one. For some reason (don’t ask) I had to update a content type in a Feature Receiver (I would have preferred to have created a new content type and inherit) by adding a new field to it. Here’s the code, purely for my personal reference but open in case other people […]