SlideShare a Scribd company logo
1 of 21
SharePoint 2010: Developing with Data Technologies Randy Williams Synergy rwilliams@synergyonline.com
About the Speaker US-West Coast Manager for Synergy Based in San Diego, California Consultant/Trainer/Author SharePoint MVP Specialty in architecting solutions Blog: www.synergyonline.com/randy Twitter: @tweetraw
Session Overview LINQ to SharePoint WCF Data Services (REST) Client Object Model Large List Throttling
Overview of Data Technologies
LINQ to SharePoint SharePoint now includes a LINQ provider Translates LINQ queries to CAML queries All access to data is through strongly typed objects Supports full CRUD operations Use SPMetal to generate proxy classes
Why Use LINQ to SharePoint? SPQuery with CAML SPQuery query = new SPQuery(); query.Query = @" <Where>   <And>     <BeginsWith>       <FieldRef Name="LinkTitle" />       <Value Type="Text">A</Value>     </BeginsWith>     <Eq>       <FieldRef Name="WorkCountry" />       <Value Type="Text">USA</Value>     </Eq>   </And> </Where>";
Why Use LINQ to SharePoint? LINQ Syntax var contacts = from c in ctx.Contacts                where c.LastName.StartsWith ("A") &&  c.CountryRegion == "USA"                select c;
Using SPMetal Command line utility located in 14IN Used to generate proxy class Generates entity classes for a single web Use CKSDev (CodePlex) to integrate with Visual Studio Basic Syntax: SPMetal /web:http://sp2010/teamsite /code:teamsite.cs
Demo LINQ to SharePoint
WCF Data Services (REST) REST: Representational State Transfer List data is made available at http://sp2010/site/_vti_bin/listdata.svc Data access is strongly typed Data access is limited to items in lists Data can be accessed from virtually any client application
REST Examples View available lists http://sp2010/_vti_bin/listdata.svc View data in the Announcements list http://sp2010/_vti_bin/listdata.svc/Announcements View the announcement with ID 1 http://sp2010/_vti_bin/listdata.svc/Announcements(1) View the Announcements items ordered by Modified date http://sp2010/_vti_bin/listdata.svc/Announcements?$orderby=Modified
Query Data Using REST Interface Create a new Service Reference using the appropriate Url to listdata.svc Instantiate a reference to the DataServiceContext object Query items using LINQ or extension method syntax Enumerate the results
Demo WCF Data Services (REST)
Client Object Model Working with SharePoint from client applications ECMAScript (JavaScript) Silverlight .NET Managed Much easier than calling web services Provides a subset of the functionality available in the server object model Designed to work with data within a site collection
Adding Project References ECMAScript (link from code) /_layouts/SP.js Silverlight references Microsoft.SharePoint.Client.Silverlight.dll Microsoft.SharePoint.Client.Silverlight.Runtime.dll .NET Managed references Microsoft.SharePoint.Client.dll Microsoft.SharePoint.Client.Runtime.dll
Sample From .NET Managed Code ClientContext context = new ClientContext("http://sp2010/teamsite"); Web web = context.Web; context.Load(web); context.ExecuteQuery(); MessageBox.Show (web.Title);
Sample From JavaScript varclientContext = new SP.ClientContext.get_current(); this.oWeb = clientContext.get_web(); clientContext.load(this.oWeb); clientContext.executeQueryAsync(Function.createDelegate(this,this.getSuccess), Function.createDelegate(this, this.getError));
Demo Client Object Model
Data Access Summary
Large List Throttling Prevents large queries from running Web Application level setting First threshold is 5,000 items Second threshold is 20,000 and applies if User is an administrator or auditor, and Object model override is enabled, and Code is configured to use override setting
Your Feedback is Important Please fill out a session evaluation form. Thank you!

More Related Content

Viewers also liked (6)

SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon
SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechConSharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon
SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon
 
OSP206 What's New in SharePoint 2013 Search
OSP206 What's New in SharePoint 2013 SearchOSP206 What's New in SharePoint 2013 Search
OSP206 What's New in SharePoint 2013 Search
 
SharePoint Alerts with WCF and jQuery
SharePoint Alerts with WCF and jQuerySharePoint Alerts with WCF and jQuery
SharePoint Alerts with WCF and jQuery
 
Best Practices to SharePoint Physical and Information Architecture
Best Practices to SharePoint Physical and Information ArchitectureBest Practices to SharePoint Physical and Information Architecture
Best Practices to SharePoint Physical and Information Architecture
 
Best Practice SharePoint Architecture
Best Practice SharePoint ArchitectureBest Practice SharePoint Architecture
Best Practice SharePoint Architecture
 
SharePoint Programming Basic
SharePoint Programming BasicSharePoint Programming Basic
SharePoint Programming Basic
 

More from Randy Williams

Integrating SharePoint with Exchange-2013
Integrating SharePoint with Exchange-2013Integrating SharePoint with Exchange-2013
Integrating SharePoint with Exchange-2013
Randy Williams
 
Governance - how does information & security drive your architecture
Governance - how does information & security drive your architectureGovernance - how does information & security drive your architecture
Governance - how does information & security drive your architecture
Randy Williams
 

More from Randy Williams (20)

Architecting Solutions and Systems – Randy’s Secrets to Success
Architecting Solutions and Systems – Randy’s Secrets to SuccessArchitecting Solutions and Systems – Randy’s Secrets to Success
Architecting Solutions and Systems – Randy’s Secrets to Success
 
An IT Pro Guide to Deploying and Managing SharePoint 2013 Apps
An IT Pro Guide to Deploying and Managing SharePoint 2013 AppsAn IT Pro Guide to Deploying and Managing SharePoint 2013 Apps
An IT Pro Guide to Deploying and Managing SharePoint 2013 Apps
 
Integrating SharePoint with Exchange-2013
Integrating SharePoint with Exchange-2013Integrating SharePoint with Exchange-2013
Integrating SharePoint with Exchange-2013
 
Governing and managing hybrid SharePoint environments
Governing and managing hybrid SharePoint environmentsGoverning and managing hybrid SharePoint environments
Governing and managing hybrid SharePoint environments
 
When governance lacks compliance
When governance lacks complianceWhen governance lacks compliance
When governance lacks compliance
 
The Future of Social Collaboration
The Future of Social CollaborationThe Future of Social Collaboration
The Future of Social Collaboration
 
Getting Started with SharePoint 2013 Apps
Getting Started with SharePoint 2013 AppsGetting Started with SharePoint 2013 Apps
Getting Started with SharePoint 2013 Apps
 
Building the next generation of browser apps today
Building the next generation of browser apps todayBuilding the next generation of browser apps today
Building the next generation of browser apps today
 
SQL Server 2012 and SharePoint 2010: Reporting Nirvana
SQL Server 2012 and SharePoint 2010: Reporting NirvanaSQL Server 2012 and SharePoint 2010: Reporting Nirvana
SQL Server 2012 and SharePoint 2010: Reporting Nirvana
 
How governance drives your information and security architecture
How governance drives your information and security architectureHow governance drives your information and security architecture
How governance drives your information and security architecture
 
Sizing your Content Databases: Understanding the Limits
Sizing your Content Databases: Understanding the LimitsSizing your Content Databases: Understanding the Limits
Sizing your Content Databases: Understanding the Limits
 
SharePoint Online and the Cloud
SharePoint Online and the CloudSharePoint Online and the Cloud
SharePoint Online and the Cloud
 
Enforcing SharePoint Governance
Enforcing SharePoint GovernanceEnforcing SharePoint Governance
Enforcing SharePoint Governance
 
Migrating to Office 365
Migrating to Office 365Migrating to Office 365
Migrating to Office 365
 
Governance - how does information & security drive your architecture
Governance - how does information & security drive your architectureGovernance - how does information & security drive your architecture
Governance - how does information & security drive your architecture
 
Understanding SharePoint Governance
Understanding SharePoint GovernanceUnderstanding SharePoint Governance
Understanding SharePoint Governance
 
Why I Use SharePoint
Why I Use SharePointWhy I Use SharePoint
Why I Use SharePoint
 
Guiding a Successful SharePoint Implementation
Guiding a Successful SharePoint ImplementationGuiding a Successful SharePoint Implementation
Guiding a Successful SharePoint Implementation
 
Plugging holes in your SharePoint 2010 disaster recovery strategy
Plugging holes in your SharePoint 2010 disaster recovery strategyPlugging holes in your SharePoint 2010 disaster recovery strategy
Plugging holes in your SharePoint 2010 disaster recovery strategy
 
Spicing up SharePoint web parts
Spicing up SharePoint web partsSpicing up SharePoint web parts
Spicing up SharePoint web parts
 

Recently uploaded

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Recently uploaded (20)

Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

SharePoint 2010: Developing with Data Technologies

  • 1. SharePoint 2010: Developing with Data Technologies Randy Williams Synergy rwilliams@synergyonline.com
  • 2. About the Speaker US-West Coast Manager for Synergy Based in San Diego, California Consultant/Trainer/Author SharePoint MVP Specialty in architecting solutions Blog: www.synergyonline.com/randy Twitter: @tweetraw
  • 3. Session Overview LINQ to SharePoint WCF Data Services (REST) Client Object Model Large List Throttling
  • 4. Overview of Data Technologies
  • 5. LINQ to SharePoint SharePoint now includes a LINQ provider Translates LINQ queries to CAML queries All access to data is through strongly typed objects Supports full CRUD operations Use SPMetal to generate proxy classes
  • 6. Why Use LINQ to SharePoint? SPQuery with CAML SPQuery query = new SPQuery(); query.Query = @" <Where> <And> <BeginsWith> <FieldRef Name="LinkTitle" /> <Value Type="Text">A</Value> </BeginsWith> <Eq> <FieldRef Name="WorkCountry" /> <Value Type="Text">USA</Value> </Eq> </And> </Where>";
  • 7. Why Use LINQ to SharePoint? LINQ Syntax var contacts = from c in ctx.Contacts where c.LastName.StartsWith ("A") && c.CountryRegion == "USA" select c;
  • 8. Using SPMetal Command line utility located in 14IN Used to generate proxy class Generates entity classes for a single web Use CKSDev (CodePlex) to integrate with Visual Studio Basic Syntax: SPMetal /web:http://sp2010/teamsite /code:teamsite.cs
  • 9. Demo LINQ to SharePoint
  • 10. WCF Data Services (REST) REST: Representational State Transfer List data is made available at http://sp2010/site/_vti_bin/listdata.svc Data access is strongly typed Data access is limited to items in lists Data can be accessed from virtually any client application
  • 11. REST Examples View available lists http://sp2010/_vti_bin/listdata.svc View data in the Announcements list http://sp2010/_vti_bin/listdata.svc/Announcements View the announcement with ID 1 http://sp2010/_vti_bin/listdata.svc/Announcements(1) View the Announcements items ordered by Modified date http://sp2010/_vti_bin/listdata.svc/Announcements?$orderby=Modified
  • 12. Query Data Using REST Interface Create a new Service Reference using the appropriate Url to listdata.svc Instantiate a reference to the DataServiceContext object Query items using LINQ or extension method syntax Enumerate the results
  • 13. Demo WCF Data Services (REST)
  • 14. Client Object Model Working with SharePoint from client applications ECMAScript (JavaScript) Silverlight .NET Managed Much easier than calling web services Provides a subset of the functionality available in the server object model Designed to work with data within a site collection
  • 15. Adding Project References ECMAScript (link from code) /_layouts/SP.js Silverlight references Microsoft.SharePoint.Client.Silverlight.dll Microsoft.SharePoint.Client.Silverlight.Runtime.dll .NET Managed references Microsoft.SharePoint.Client.dll Microsoft.SharePoint.Client.Runtime.dll
  • 16. Sample From .NET Managed Code ClientContext context = new ClientContext("http://sp2010/teamsite"); Web web = context.Web; context.Load(web); context.ExecuteQuery(); MessageBox.Show (web.Title);
  • 17. Sample From JavaScript varclientContext = new SP.ClientContext.get_current(); this.oWeb = clientContext.get_web(); clientContext.load(this.oWeb); clientContext.executeQueryAsync(Function.createDelegate(this,this.getSuccess), Function.createDelegate(this, this.getError));
  • 20. Large List Throttling Prevents large queries from running Web Application level setting First threshold is 5,000 items Second threshold is 20,000 and applies if User is an administrator or auditor, and Object model override is enabled, and Code is configured to use override setting
  • 21. Your Feedback is Important Please fill out a session evaluation form. Thank you!