SlideShare a Scribd company logo
SHAREPOINT 2010
CLIENT SIDE OBJECT
MODEL
Phil Wicklund
SharePoint FREEWARE
www.PhilWicklund.com
SharePoint CONSULTING
www.RBAconsulting.com
About Me?
Training & Certifications:
• MCTIP: SharePoint 2010 Administration
• MCPD: SharePoint 2010 Development
• Microsoft’s SharePoint Masters Training (Redmond, WA)
Other Notable Experience:
• Published Author on SharePoint 2010 (SharePoint 2010 Workflows in
Action)
• National Speaker at SharePoint Conferences (The Experts Conference-LA,
SharePoint Technology Conference-San Fran, TechFuse-MN,
SharePoint Saturdays)
• SharePoint Blog: www.philwicklund.com
About Me: Over 6 years of experience SharePoint Architecture Experience, trained
SharePoint architecture and development classes for nationally renown SharePoint-
focused training organization.
Agenda
 Introduction / Why COM?
 COM Architecture
 Coding Samples
 DEMO
 .NET COM
 Questions
SharePoint FREEWARE
www.PhilWicklund.com
SharePoint CONSULTING
www.RBAconsulting.com
Intro to the SP 2010 COM
 Not enough web services in SP 2007
 Rather than create more services, COM
provides the complete API
 COM provides a consistent development
experience:
 Windows Applications
 ASP.NET web sites
 Silverlight Applications
 JavaScript, www client side scripting
SharePoint FREEWARE
www.PhilWicklund.com
SharePoint CONSULTING
www.RBAconsulting.com
COM Architecture
SharePoint FREEWARE
www.PhilWicklund.com
SharePoint CONSULTING
www.RBAconsulting.com
Assembly References
 SharePoint, Server Side
 Microsoft.SharePoint (ISAPI)
 .NET clients
 Microsoft.SharePoint.Client (ISAPI)
 Silverlight clients
 Microsoft.SharePoint.Client.Silverlight
(Layouts/clientbin)
 Javascript clients
 SP.js & SP.Core.js (Layouts)SharePoint FREEWARE
www.PhilWicklund.com
SharePoint CONSULTING
www.RBAconsulting.com
Comparable Objects
Microsoft.SharePoint Client Object Models
SPContext ClientContext
SPSite Site
SPWeb Web
SPList List
SPListItem ListItem
SPField Field
SPFile File
SharePoint FREEWARE
www.PhilWicklund.com
SharePoint CONSULTING
www.RBAconsulting.com
Starter Code
Using Microsoft.SharePoint.Client;
...
using (ClientContext context = new
ClientContext("http://intranet"))
{
Web web = context.Web;
context.Load(web);
context.ExecuteQuery();
string title = web.Title;
// ListCollection lists = web.Lists;
}
SharePoint FREEWARE
www.PhilWicklund.com
SharePoint CONSULTING
www.RBAconsulting.com
Iterating through Lists in a Web
using (ClientContext context = new
ClientContext("http://intranet"))
{
Web web = context.Web;
context.Load(web);
context.Load(web.Lists);
context.ExecuteQuery();
foreach(List list in web.Lists)
{
//do something
}
}
SharePoint FREEWARE
www.PhilWicklund.com
SharePoint CONSULTING
www.RBAconsulting.com
Efficiencies… Don’t be Lazy!
Web web = context.Web;
context.Load(web, wprop => wprop.Title));
ListCollection lists = web.Lists;
IEnumerable<List> filtered = context.
LoadQuery(lists.Include(l=>l.Title));
context.ExecuteQuery();
foreach(List list in filtered)
{ }
SharePoint FREEWARE
www.PhilWicklund.com
SharePoint CONSULTING
www.RBAconsulting.com
Working with List Items
Web web = context.Web;
List list = context.Web.Lists.
GetByTitle(“List Title");
CamlQuery query = CamlQuery.CreateAllItemsQuery();
ListItemCollection items = lst.GetItems(query);
context.Load(items);
context.ExecuteQuery();
foreach (ListItem item in items)
{
string title = item["Title"];
}
SharePoint FREEWARE
www.PhilWicklund.com
SharePoint CONSULTING
www.RBAconsulting.com
Efficencies with List Items
CamlQuery query = new CamlQuery();
query.ViewXml = "<View><Query><Where><Eq>
<FieldRef Name='Title'/><Value
Type='Text'>Phil</Value>
</Eq></Where></Query></View>";
ListItemCollection items = list.GetItems(query);
context.Load(items, x => x.Include(
item => item["ID"],
item => item["Title"],
item => item.DisplayName));
SharePoint FREEWARE
www.PhilWicklund.com
SharePoint CONSULTING
www.RBAconsulting.com
Adding new List Items
List list = context.Web.Lists.
GetByTitle(“List Title");
context.Load(list);
ListItem newItem = list.AddItem(new
ListItemCreationInformation());
newItem["Title"] = "My new item";
newItem.Update();
context.ExecuteQuery();
SharePoint FREEWARE
www.PhilWicklund.com
SharePoint CONSULTING
www.RBAconsulting.com
Silverlight & Asynchronous Calls
private void Button_Click(object sender, RoutedEventArgs e)
{
// Load a bunch of stuff
clientContext.ExecuteQueryAsync(success, failure);
}
private void success(object sender,
ClientRequestSucceededEventArgs args)
{
RunQuery runQuery= Run;
this.Dispatcher.BeginInvoke(runQuery);
}
private delegate void RunQuery();
private void Run() { /* do something */ }
private void failure(object sender,
ClientRequestFailedEventArgs args) { /* do something */ }
SharePoint FREEWARE
www.PhilWicklund.com
SharePoint CONSULTING
www.RBAconsulting.com
.NET – COM Demo
 Build a Console (client) Application
 Render all the
List Titles from a remote
SharePoint site.
 Create a new list item
in a remote SharePoint
site.
SharePoint FREEWARE
www.PhilWicklund.com
SharePoint CONSULTING
www.RBAconsulting.com
QUESTIONS & COMMENTS
Phil Wicklund
SharePoint FREEWARE
www.PhilWicklund.com
SharePoint CONSULTING
www.RBAConsulting.com

More Related Content

PPTX
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
PPTX
Data Access Options in SharePoint 2010
PPTX
Advanced SharePoint Web Part Development
PPTX
SharePoint 2010 Application Development Overview
PPTX
Integrating SharePoint 2010 and Visual Studio Lightswitch
KEY
SharePoint 2010 Client Object Model
PPTX
Introduction to the SharePoint Client Object Model and REST API
PPT
Introduction to the Client OM in SharePoint 2010
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
Data Access Options in SharePoint 2010
Advanced SharePoint Web Part Development
SharePoint 2010 Application Development Overview
Integrating SharePoint 2010 and Visual Studio Lightswitch
SharePoint 2010 Client Object Model
Introduction to the SharePoint Client Object Model and REST API
Introduction to the Client OM in SharePoint 2010

What's hot (20)

PPTX
Introduction to the SharePoint 2013 REST API
PPTX
Understanding and programming the SharePoint REST API
PDF
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
PDF
Taking Advantage of the SharePoint 2013 REST API
PPTX
SharePoint Client Object Model (CSOM)
PPTX
SharePoint 2013 REST APIs
PPTX
Are you getting Sleepy. REST in SharePoint Apps
DOCX
SharePoint 2013 REST API & Remote Authentication
PPTX
Develop iOS and Android apps with SharePoint/Office 365
PPS
SharePoint 2007 Presentation
PPT
Sharepoint Online
PDF
Who Are You and What Do You Want? Working with OAuth in SharePoint 2013.
PPT
Asp.net.
DOCX
Working With Sharepoint 2013 Apps Development
PPTX
CSOM (Client Side Object Model). Explained @ SharePoint Saturday Houston
PPT
Server Controls of ASP.Net
PPT
Asp.net server controls
PDF
Toms introtospring mvc
PPTX
Introduction to using jQuery with SharePoint
Introduction to the SharePoint 2013 REST API
Understanding and programming the SharePoint REST API
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
Taking Advantage of the SharePoint 2013 REST API
SharePoint Client Object Model (CSOM)
SharePoint 2013 REST APIs
Are you getting Sleepy. REST in SharePoint Apps
SharePoint 2013 REST API & Remote Authentication
Develop iOS and Android apps with SharePoint/Office 365
SharePoint 2007 Presentation
Sharepoint Online
Who Are You and What Do You Want? Working with OAuth in SharePoint 2013.
Asp.net.
Working With Sharepoint 2013 Apps Development
CSOM (Client Side Object Model). Explained @ SharePoint Saturday Houston
Server Controls of ASP.Net
Asp.net server controls
Toms introtospring mvc
Introduction to using jQuery with SharePoint
Ad

Viewers also liked (19)

PPTX
Protección jurídica del software
PPTX
Valentine's Day Back to Back
PDF
Dokumentacija-Ana
PDF
Tilastollisen vaihtelun ilmentäminen
DOCX
Senior Internship Paper
PPTX
Gyostage 15.10.2016
PDF
Jim Nicholls CV 22 Oct 2015
PPTX
Deployment no Azure
PPTX
TVT-strategiat - Vaasan kaupungin sivistystoimi
PDF
Digiloikasta pedaloikkaan
PDF
Koodikerho PEPE Pajapäivä 6.9.2016
PPT
Treaty of paris
PDF
fazaia inter college lahore 9th class papers examination
PPTX
Biogeochemical cycle
DOC
Final examination 2011 class vi
DOC
Mid term examination -2011 class vi
PDF
ΠΛΗ31 ΚΑΡΤΕΣ ΜΑΘΗΜΑΤΟΣ 3.5 (ΕΚΤΥΠΩΣΗ)
PDF
ΠΛΗ31 ΚΑΡΤΕΣ ΜΑΘΗΜΑΤΟΣ 3.4 (ΕΚΤΥΠΩΣΗ)
PPTX
Web Design Trends: Ins & Outs
Protección jurídica del software
Valentine's Day Back to Back
Dokumentacija-Ana
Tilastollisen vaihtelun ilmentäminen
Senior Internship Paper
Gyostage 15.10.2016
Jim Nicholls CV 22 Oct 2015
Deployment no Azure
TVT-strategiat - Vaasan kaupungin sivistystoimi
Digiloikasta pedaloikkaan
Koodikerho PEPE Pajapäivä 6.9.2016
Treaty of paris
fazaia inter college lahore 9th class papers examination
Biogeochemical cycle
Final examination 2011 class vi
Mid term examination -2011 class vi
ΠΛΗ31 ΚΑΡΤΕΣ ΜΑΘΗΜΑΤΟΣ 3.5 (ΕΚΤΥΠΩΣΗ)
ΠΛΗ31 ΚΑΡΤΕΣ ΜΑΘΗΜΑΤΟΣ 3.4 (ΕΚΤΥΠΩΣΗ)
Web Design Trends: Ins & Outs
Ad

Similar to SharePoint 2010 Client-side Object Model (20)

PPTX
Custom SharePoint 2010 solutions without server access
PPTX
Getting Started with SharePoint Development
PPTX
SharePoint Silverlight Sandboxed solutions
PPTX
Share point development 101
PPTX
Intro to SharePoint Web Services
PPTX
SharePoint 2010 developer overview (in Visual Studio 2010)
PPTX
What’s New for Devs
PPTX
Developing With Data Technologies
PPTX
Spicing up SharePoint web parts
PPTX
Building a Social Media "Listener" with SharePoint Designer
PPTX
Access SharePoint Remotely
PDF
SharePoint 2010 101 @ SPSVB
PPTX
SP2010 Developer Tools
PPTX
SharePoint Benefits
PPTX
Share Point Object Model
PPTX
sharepointbenefits-140515054702-phpapp02.pptx
PPTX
Rest API and Client OM for Developer
PPTX
Introduction to sharepoint 2010
PDF
AD107 Microsoft SharePoint meets IBM Lotus Domino
PPT
Wss Object Model
Custom SharePoint 2010 solutions without server access
Getting Started with SharePoint Development
SharePoint Silverlight Sandboxed solutions
Share point development 101
Intro to SharePoint Web Services
SharePoint 2010 developer overview (in Visual Studio 2010)
What’s New for Devs
Developing With Data Technologies
Spicing up SharePoint web parts
Building a Social Media "Listener" with SharePoint Designer
Access SharePoint Remotely
SharePoint 2010 101 @ SPSVB
SP2010 Developer Tools
SharePoint Benefits
Share Point Object Model
sharepointbenefits-140515054702-phpapp02.pptx
Rest API and Client OM for Developer
Introduction to sharepoint 2010
AD107 Microsoft SharePoint meets IBM Lotus Domino
Wss Object Model

Recently uploaded (20)

PDF
cuic standard and advanced reporting.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Chapter 3 Spatial Domain Image Processing.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PPT
Teaching material agriculture food technology
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Modernizing your data center with Dell and AMD
PDF
Approach and Philosophy of On baking technology
PPTX
A Presentation on Artificial Intelligence
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
MYSQL Presentation for SQL database connectivity
cuic standard and advanced reporting.pdf
Network Security Unit 5.pdf for BCA BBA.
Encapsulation_ Review paper, used for researhc scholars
Chapter 3 Spatial Domain Image Processing.pdf
The AUB Centre for AI in Media Proposal.docx
Teaching material agriculture food technology
20250228 LYD VKU AI Blended-Learning.pptx
Modernizing your data center with Dell and AMD
Approach and Philosophy of On baking technology
A Presentation on Artificial Intelligence
NewMind AI Monthly Chronicles - July 2025
Advanced methodologies resolving dimensionality complications for autism neur...
Digital-Transformation-Roadmap-for-Companies.pptx
Building Integrated photovoltaic BIPV_UPV.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Big Data Technologies - Introduction.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Understanding_Digital_Forensics_Presentation.pptx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
MYSQL Presentation for SQL database connectivity

SharePoint 2010 Client-side Object Model

  • 1. SHAREPOINT 2010 CLIENT SIDE OBJECT MODEL Phil Wicklund SharePoint FREEWARE www.PhilWicklund.com SharePoint CONSULTING www.RBAconsulting.com
  • 2. About Me? Training & Certifications: • MCTIP: SharePoint 2010 Administration • MCPD: SharePoint 2010 Development • Microsoft’s SharePoint Masters Training (Redmond, WA) Other Notable Experience: • Published Author on SharePoint 2010 (SharePoint 2010 Workflows in Action) • National Speaker at SharePoint Conferences (The Experts Conference-LA, SharePoint Technology Conference-San Fran, TechFuse-MN, SharePoint Saturdays) • SharePoint Blog: www.philwicklund.com About Me: Over 6 years of experience SharePoint Architecture Experience, trained SharePoint architecture and development classes for nationally renown SharePoint- focused training organization.
  • 3. Agenda  Introduction / Why COM?  COM Architecture  Coding Samples  DEMO  .NET COM  Questions SharePoint FREEWARE www.PhilWicklund.com SharePoint CONSULTING www.RBAconsulting.com
  • 4. Intro to the SP 2010 COM  Not enough web services in SP 2007  Rather than create more services, COM provides the complete API  COM provides a consistent development experience:  Windows Applications  ASP.NET web sites  Silverlight Applications  JavaScript, www client side scripting SharePoint FREEWARE www.PhilWicklund.com SharePoint CONSULTING www.RBAconsulting.com
  • 6. Assembly References  SharePoint, Server Side  Microsoft.SharePoint (ISAPI)  .NET clients  Microsoft.SharePoint.Client (ISAPI)  Silverlight clients  Microsoft.SharePoint.Client.Silverlight (Layouts/clientbin)  Javascript clients  SP.js & SP.Core.js (Layouts)SharePoint FREEWARE www.PhilWicklund.com SharePoint CONSULTING www.RBAconsulting.com
  • 7. Comparable Objects Microsoft.SharePoint Client Object Models SPContext ClientContext SPSite Site SPWeb Web SPList List SPListItem ListItem SPField Field SPFile File SharePoint FREEWARE www.PhilWicklund.com SharePoint CONSULTING www.RBAconsulting.com
  • 8. Starter Code Using Microsoft.SharePoint.Client; ... using (ClientContext context = new ClientContext("http://intranet")) { Web web = context.Web; context.Load(web); context.ExecuteQuery(); string title = web.Title; // ListCollection lists = web.Lists; } SharePoint FREEWARE www.PhilWicklund.com SharePoint CONSULTING www.RBAconsulting.com
  • 9. Iterating through Lists in a Web using (ClientContext context = new ClientContext("http://intranet")) { Web web = context.Web; context.Load(web); context.Load(web.Lists); context.ExecuteQuery(); foreach(List list in web.Lists) { //do something } } SharePoint FREEWARE www.PhilWicklund.com SharePoint CONSULTING www.RBAconsulting.com
  • 10. Efficiencies… Don’t be Lazy! Web web = context.Web; context.Load(web, wprop => wprop.Title)); ListCollection lists = web.Lists; IEnumerable<List> filtered = context. LoadQuery(lists.Include(l=>l.Title)); context.ExecuteQuery(); foreach(List list in filtered) { } SharePoint FREEWARE www.PhilWicklund.com SharePoint CONSULTING www.RBAconsulting.com
  • 11. Working with List Items Web web = context.Web; List list = context.Web.Lists. GetByTitle(“List Title"); CamlQuery query = CamlQuery.CreateAllItemsQuery(); ListItemCollection items = lst.GetItems(query); context.Load(items); context.ExecuteQuery(); foreach (ListItem item in items) { string title = item["Title"]; } SharePoint FREEWARE www.PhilWicklund.com SharePoint CONSULTING www.RBAconsulting.com
  • 12. Efficencies with List Items CamlQuery query = new CamlQuery(); query.ViewXml = "<View><Query><Where><Eq> <FieldRef Name='Title'/><Value Type='Text'>Phil</Value> </Eq></Where></Query></View>"; ListItemCollection items = list.GetItems(query); context.Load(items, x => x.Include( item => item["ID"], item => item["Title"], item => item.DisplayName)); SharePoint FREEWARE www.PhilWicklund.com SharePoint CONSULTING www.RBAconsulting.com
  • 13. Adding new List Items List list = context.Web.Lists. GetByTitle(“List Title"); context.Load(list); ListItem newItem = list.AddItem(new ListItemCreationInformation()); newItem["Title"] = "My new item"; newItem.Update(); context.ExecuteQuery(); SharePoint FREEWARE www.PhilWicklund.com SharePoint CONSULTING www.RBAconsulting.com
  • 14. Silverlight & Asynchronous Calls private void Button_Click(object sender, RoutedEventArgs e) { // Load a bunch of stuff clientContext.ExecuteQueryAsync(success, failure); } private void success(object sender, ClientRequestSucceededEventArgs args) { RunQuery runQuery= Run; this.Dispatcher.BeginInvoke(runQuery); } private delegate void RunQuery(); private void Run() { /* do something */ } private void failure(object sender, ClientRequestFailedEventArgs args) { /* do something */ } SharePoint FREEWARE www.PhilWicklund.com SharePoint CONSULTING www.RBAconsulting.com
  • 15. .NET – COM Demo  Build a Console (client) Application  Render all the List Titles from a remote SharePoint site.  Create a new list item in a remote SharePoint site. SharePoint FREEWARE www.PhilWicklund.com SharePoint CONSULTING www.RBAconsulting.com
  • 16. QUESTIONS & COMMENTS Phil Wicklund SharePoint FREEWARE www.PhilWicklund.com SharePoint CONSULTING www.RBAConsulting.com