Tutorial by Examples

2013 SharePoint 2013 and newer versions are 64-bit only and so the assembly/program needs to be also built for 64-bit processor. Right after your project is created it is necessary to swich the Platform target from Any CPU to x64 otherwise error will occure. using System; using Microsoft.Share...
Using PowerShell executed from a SharePoint Web Server: $wacoll = get-spwebapplication foreach($wa in $wacoll){ if($wa.IsAdministrationWebApplication -eq $false){ foreach($site in $wa.Sites){ foreach($web in $site.AllWebs){ # your code here ...
using (SPSite site = new SPSite("http://server/sites/siteCollection")) using (SPWeb web = site.OpenWeb()) { SPList list = web.Lists["Some list"]; // It is always better and faster to query list items with GetItems method with // empty SPQuery object than to use...
using (SPSite site = new SPSite("http://server/sites/siteCollection")) using (SPWeb web = site.OpenWeb()) { SPList list = web.Lists["Some list"]; SPQuery query = new SPQuery() { RowLimit = 100 }; do { SPListItemCollection items ...
using (SPSite site = new SPSite("http://server/sites/siteCollection")) using (SPWeb web = site.OpenWeb()) { string listUrl = string.Format("{0}{1}", web.ServerRelativeUrl, "Lists/SomeList"); SPList list = web.GetList(listUrl); }
When creating a new list item, its fields can be set using syntax similar to string arrays. Note that these fields are not created on the fly and are defined by the schema of the list. These fields (or columns) must exist on the server otherwise the create will fail. All list items will have the Tit...

Page 1 of 1