SlideShare una empresa de Scribd logo
1 de 19
Working With SharePoint DataOctober 8, 2009 Joseph Ackerman, Senior ConsultantMicrosoft Consulting Services, GICS, Dell Inc.joseph_ackerman@dell.com
The Ever-Popular Intro Slide Joseph Ackerman (joseph_ackerman@dell.com) 20 + years of software development for clients of all sizes and shapes Wells Fargo Hewlett-Packard Aetna Visa Stanford University Currently consulting as part of Dell’s Microsoft Consulting Services Formerly Allin, Microsoft’s Northwest Region Partner of the Year 2008 Most recent project: internal systems for eBay
Agenda What it’s not The big (overall) “why” SharePoint storage The SharePoint data object model The custom ListInfo web part The little (specific) “why” Finding what’s hidden Queries Summary and wrap-up
What this talk is not It’s not about how to build web parts However, we will build some It’s not a CAML tutorial But we will discuss it and use it a bit It’s pretty much unavoidable It’s not a solution to all your SharePoint data woes We could spend days talking about this stuff and not cover everything Things are getting better, but any experienced developer will tell you that SharePoint is woefully under-documented for developers Your best bet is just to dig in and start working with it
Why am I giving this talk? SharePoint is built on top of  ASP.Net 2.0  SQL Server Easy stuff, Right? Yes…but!  There are many differences between working with ASP.Net and SharePoint! One of the biggest differences is working with data stored in SharePoint. There is no ADO.Net Provider for SharePoint There is no (official) LINQ to SharePoint (yet!)
Why am I giving this talk? Until the day Microsoft sees fit to provide us with simpler, easier to use tools, our best bet is to access data in SharePoint via  The SharePoint Object Model CAML (more on this later) There’s Web Services too, but that’s another talk
Lists, Lists and more Lists SharePoint stores all of its data in a construct called a List Conceptually, Lists are like Tables in a Database Columns are referred to as Fields Rows are referred to as ListItems However, Lists have a lot more meta data They are less flexible in some ways – some things we take for granted in a database (like joins, for example) are either difficult or impossible
Where do we begin? In Context!		 You have to reference the SharePoint Libraries To communicate with SharePoint data, you have to have the proper context The SPContext object provides that for you If your code is in a web part you can use the “current” context The context object allows you to get the SPsite object (actually a “site collection”)
Sites have webs The Site Collection has one or more webs, accessible through the AllWebs collection The default web for the collection is accessed with the OpenWeb() method Each web has a collection of lists of varying types (Custom Lists, Document Libraries, Picture Libraries, Task Lists, Announcements etc.) Each List has 1-to-n Views
Object Model Map
ListInfo Web Part Demo
So, why do we need all this? First reason: SharePoint hides a bunch of stuff There are hidden lists There are hidden fields in the various list types Some built in methods don’t return everything For example SPList.Items.GetDataTable() Where are the rest of my fields?!
HiddenList Web Part Demo
So, why do we need all this? Second Reason: If you want to write queries to retrieve list items that meet specific criteria, you have to use CAML CAML queries use an XML syntax in place of SQL The field list in your query requires the use of the internal field names and their SharePoint Types There isn’t really a clean, simple, obvious place to find this information
CAML Humps CAML, while useful, has some serious shortcomings: There’s a limited number of conditions and functions There’s a lot of details about fields you MUST know or you’ll spend a lot of time debugging: Internal field names SharePoint data types Data formats for things like dates and lookup values There’s no joins – you can get values from lookup fields but that’s it CAML queries are a real pain to use in code – you can write your own helper classes or you can use some that others have written, but the ultimate result will always be a string
CAML Humps You can write your query as SQL and convert it by hand using the method found here: http://www.codeproject.com/KB/sharepoint/Sharepoint_CAML_query.aspx Or you can save yourself a lot of work by using other tools The U2U CAML Query Builder is VERY helpful
CAML Query Web Part Demo
Summary Learn and know the SharePoint data object model You may also want to learn the web services Familiarize yourself with CAML Use the available tools, and when necessary, build your own Learn to search the SharePoint blogs because the official documentation from Microsoft (even the SDK!) leaves much to be desired With apologies to Nike, “Just do it”
Resources Tools U2U CAML Query Builder LINQ to SharePoint (CodePlex) Stramit CAML Viewer 2007 (CodePlex) Blogs Andrew Connell  Heather Solomon http://www.sharepointblogs.com/ Books Professional SharePoint 2007 Web Content Management Development by Andrew Connell Microsoft SharePoint 2007 Development Unleashed by Kevin Hoffman and Robert Foster Developer's Guide to the Windows SharePoint Services v3 Platform  by Todd Bleeker

Más contenido relacionado

La actualidad más candente

Building Your First Store App with XAML and C#
Building Your First Store App with XAML and C#Building Your First Store App with XAML and C#
Building Your First Store App with XAML and C#Tamir Dresher
 
How to get better looking search results in SharePoint with Display Templates
How to get better looking search results in SharePoint with Display TemplatesHow to get better looking search results in SharePoint with Display Templates
How to get better looking search results in SharePoint with Display TemplatesKieferConsulting
 
SPEVO13 - Dev212 - Document Assembly Deep Dive Part 1
SPEVO13 - Dev212 - Document Assembly Deep Dive Part 1SPEVO13 - Dev212 - Document Assembly Deep Dive Part 1
SPEVO13 - Dev212 - Document Assembly Deep Dive Part 1John F. Holliday
 
SharePoint 2010 Search
SharePoint 2010 SearchSharePoint 2010 Search
SharePoint 2010 SearchRegroove
 
#SPSTC Maximizing the SharePoint User Experience with Free 3rd Party jQuery L...
#SPSTC Maximizing the SharePoint User Experience with Free 3rd Party jQuery L...#SPSTC Maximizing the SharePoint User Experience with Free 3rd Party jQuery L...
#SPSTC Maximizing the SharePoint User Experience with Free 3rd Party jQuery L...Mark Rackley
 
7 ref works search for ref in refworks
7 ref works search for ref in refworks7 ref works search for ref in refworks
7 ref works search for ref in refworksUCT
 
SPSNYC 2016 - Big data in SharePoint and the 5,000 Item List View Threshold
SPSNYC 2016 - Big data in SharePoint and the 5,000 Item List View ThresholdSPSNYC 2016 - Big data in SharePoint and the 5,000 Item List View Threshold
SPSNYC 2016 - Big data in SharePoint and the 5,000 Item List View ThresholdBen Steinhauser
 
SharePoint site collection and content migrations into SharePoint 2013 and O365
SharePoint site collection and content migrations into SharePoint 2013 and O365SharePoint site collection and content migrations into SharePoint 2013 and O365
SharePoint site collection and content migrations into SharePoint 2013 and O365techrevmarrell
 
Cortana Analytics Workshop: Developing for Power BI
Cortana Analytics Workshop: Developing for Power BICortana Analytics Workshop: Developing for Power BI
Cortana Analytics Workshop: Developing for Power BIMSAdvAnalytics
 
Lunch & Learn : Comment gagner 30 minutes par jour avec Excel?
Lunch & Learn : Comment gagner 30 minutes par jour avec Excel?Lunch & Learn : Comment gagner 30 minutes par jour avec Excel?
Lunch & Learn : Comment gagner 30 minutes par jour avec Excel?Aurelium
 
Five Things I Wish I Knew the First Day I Used Tableau
Five Things I Wish I Knew the First Day I Used TableauFive Things I Wish I Knew the First Day I Used Tableau
Five Things I Wish I Knew the First Day I Used TableauRyan Sleeper
 
Html5 structure & semantic
Html5 structure & semanticHtml5 structure & semantic
Html5 structure & semanticMuktadiur Rahman
 

La actualidad más candente (20)

Extracting deliverables from DITA
Extracting deliverables from DITAExtracting deliverables from DITA
Extracting deliverables from DITA
 
Building Your First Store App with XAML and C#
Building Your First Store App with XAML and C#Building Your First Store App with XAML and C#
Building Your First Store App with XAML and C#
 
Comp107 unit 5,6
Comp107 unit 5,6Comp107 unit 5,6
Comp107 unit 5,6
 
How to get better looking search results in SharePoint with Display Templates
How to get better looking search results in SharePoint with Display TemplatesHow to get better looking search results in SharePoint with Display Templates
How to get better looking search results in SharePoint with Display Templates
 
Html5
Html5Html5
Html5
 
VSTO
VSTOVSTO
VSTO
 
SPEVO13 - Dev212 - Document Assembly Deep Dive Part 1
SPEVO13 - Dev212 - Document Assembly Deep Dive Part 1SPEVO13 - Dev212 - Document Assembly Deep Dive Part 1
SPEVO13 - Dev212 - Document Assembly Deep Dive Part 1
 
SharePoint 2010 Search
SharePoint 2010 SearchSharePoint 2010 Search
SharePoint 2010 Search
 
#SPSTC Maximizing the SharePoint User Experience with Free 3rd Party jQuery L...
#SPSTC Maximizing the SharePoint User Experience with Free 3rd Party jQuery L...#SPSTC Maximizing the SharePoint User Experience with Free 3rd Party jQuery L...
#SPSTC Maximizing the SharePoint User Experience with Free 3rd Party jQuery L...
 
7 ref works search for ref in refworks
7 ref works search for ref in refworks7 ref works search for ref in refworks
7 ref works search for ref in refworks
 
SPSNYC 2016 - Big data in SharePoint and the 5,000 Item List View Threshold
SPSNYC 2016 - Big data in SharePoint and the 5,000 Item List View ThresholdSPSNYC 2016 - Big data in SharePoint and the 5,000 Item List View Threshold
SPSNYC 2016 - Big data in SharePoint and the 5,000 Item List View Threshold
 
SharePoint site collection and content migrations into SharePoint 2013 and O365
SharePoint site collection and content migrations into SharePoint 2013 and O365SharePoint site collection and content migrations into SharePoint 2013 and O365
SharePoint site collection and content migrations into SharePoint 2013 and O365
 
Zup Zip Share Point
Zup Zip Share PointZup Zip Share Point
Zup Zip Share Point
 
Cortana Analytics Workshop: Developing for Power BI
Cortana Analytics Workshop: Developing for Power BICortana Analytics Workshop: Developing for Power BI
Cortana Analytics Workshop: Developing for Power BI
 
D4 Introduction to LINQ
D4 Introduction to LINQD4 Introduction to LINQ
D4 Introduction to LINQ
 
Lunch & Learn : Comment gagner 30 minutes par jour avec Excel?
Lunch & Learn : Comment gagner 30 minutes par jour avec Excel?Lunch & Learn : Comment gagner 30 minutes par jour avec Excel?
Lunch & Learn : Comment gagner 30 minutes par jour avec Excel?
 
Tableau Server Basics
Tableau Server BasicsTableau Server Basics
Tableau Server Basics
 
Share Point Object Model
Share Point Object ModelShare Point Object Model
Share Point Object Model
 
Five Things I Wish I Knew the First Day I Used Tableau
Five Things I Wish I Knew the First Day I Used TableauFive Things I Wish I Knew the First Day I Used Tableau
Five Things I Wish I Knew the First Day I Used Tableau
 
Html5 structure & semantic
Html5 structure & semanticHtml5 structure & semantic
Html5 structure & semantic
 

Similar a Working With SharePoint Data and Queries

So You Want to Be a SharePoint Developer - SPS Utah 2015
So You Want to Be a SharePoint Developer - SPS Utah 2015So You Want to Be a SharePoint Developer - SPS Utah 2015
So You Want to Be a SharePoint Developer - SPS Utah 2015Ryan Schouten
 
So You Want To Be A SharePoint Developer-SPS Silicon Valley 2015
So You Want To Be A SharePoint Developer-SPS Silicon Valley 2015So You Want To Be A SharePoint Developer-SPS Silicon Valley 2015
So You Want To Be A SharePoint Developer-SPS Silicon Valley 2015Ryan Schouten
 
Learn Entity Framework in a day with Code First, Model First and Database First
Learn Entity Framework in a day with Code First, Model First and Database FirstLearn Entity Framework in a day with Code First, Model First and Database First
Learn Entity Framework in a day with Code First, Model First and Database FirstJibran Rasheed Khan
 
Data Federation/EII Uses And Abuses
Data Federation/EII Uses And AbusesData Federation/EII Uses And Abuses
Data Federation/EII Uses And Abusesmark madsen
 
Xml Data Feeds And Web Services For Affiliates
Xml Data Feeds And Web Services For AffiliatesXml Data Feeds And Web Services For Affiliates
Xml Data Feeds And Web Services For AffiliatesCarsten Cumbrowski
 
Kellogg XML Holland Speech
Kellogg XML Holland SpeechKellogg XML Holland Speech
Kellogg XML Holland SpeechDave Kellogg
 
Solve Todays Problems with 10 New SharePoint 2010 Features
Solve Todays Problems with 10 New SharePoint 2010 FeaturesSolve Todays Problems with 10 New SharePoint 2010 Features
Solve Todays Problems with 10 New SharePoint 2010 FeaturesCory Peters
 
Kql and the content search web part
Kql and the content search web part Kql and the content search web part
Kql and the content search web part InnoTech
 
Extending Your Experience to the Office
Extending Your Experience to the OfficeExtending Your Experience to the Office
Extending Your Experience to the Officegoodfriday
 
Getting started with SAP PI/PO an overview presentation
Getting started with SAP PI/PO an overview presentationGetting started with SAP PI/PO an overview presentation
Getting started with SAP PI/PO an overview presentationFigaf.com
 
SPC Master Power User SharePoint & Office 365
SPC Master Power User SharePoint & Office 365SPC Master Power User SharePoint & Office 365
SPC Master Power User SharePoint & Office 365Benjamin Niaulin
 
SharePoint 2010 Developer 101
SharePoint 2010 Developer 101SharePoint 2010 Developer 101
SharePoint 2010 Developer 101Nick Hadlee
 
Where did design view go in SharePoint Designer
Where did design view go in SharePoint DesignerWhere did design view go in SharePoint Designer
Where did design view go in SharePoint DesignerPatrick O'Toole
 
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 ArchitectureJoel Oleson
 
Custom SharePoint 2010 solutions without server access
Custom SharePoint 2010 solutions without server accessCustom SharePoint 2010 solutions without server access
Custom SharePoint 2010 solutions without server accessPhil Wicklund
 
ArcReady - Architecting For The Cloud
ArcReady - Architecting For The CloudArcReady - Architecting For The Cloud
ArcReady - Architecting For The CloudMicrosoft ArcReady
 
SharePoint and Open XML
SharePoint and Open XMLSharePoint and Open XML
SharePoint and Open XMLBecky Bertram
 

Similar a Working With SharePoint Data and Queries (20)

So You Want to Be a SharePoint Developer - SPS Utah 2015
So You Want to Be a SharePoint Developer - SPS Utah 2015So You Want to Be a SharePoint Developer - SPS Utah 2015
So You Want to Be a SharePoint Developer - SPS Utah 2015
 
So You Want To Be A SharePoint Developer-SPS Silicon Valley 2015
So You Want To Be A SharePoint Developer-SPS Silicon Valley 2015So You Want To Be A SharePoint Developer-SPS Silicon Valley 2015
So You Want To Be A SharePoint Developer-SPS Silicon Valley 2015
 
Learn Entity Framework in a day with Code First, Model First and Database First
Learn Entity Framework in a day with Code First, Model First and Database FirstLearn Entity Framework in a day with Code First, Model First and Database First
Learn Entity Framework in a day with Code First, Model First and Database First
 
Data Federation/EII Uses And Abuses
Data Federation/EII Uses And AbusesData Federation/EII Uses And Abuses
Data Federation/EII Uses And Abuses
 
Xml Data Feeds And Web Services For Affiliates
Xml Data Feeds And Web Services For AffiliatesXml Data Feeds And Web Services For Affiliates
Xml Data Feeds And Web Services For Affiliates
 
Kellogg XML Holland Speech
Kellogg XML Holland SpeechKellogg XML Holland Speech
Kellogg XML Holland Speech
 
Solve Todays Problems with 10 New SharePoint 2010 Features
Solve Todays Problems with 10 New SharePoint 2010 FeaturesSolve Todays Problems with 10 New SharePoint 2010 Features
Solve Todays Problems with 10 New SharePoint 2010 Features
 
Kql and the content search web part
Kql and the content search web part Kql and the content search web part
Kql and the content search web part
 
Extending Your Experience to the Office
Extending Your Experience to the OfficeExtending Your Experience to the Office
Extending Your Experience to the Office
 
Intro to Application Express
Intro to Application ExpressIntro to Application Express
Intro to Application Express
 
Entity Framework 4
Entity Framework 4Entity Framework 4
Entity Framework 4
 
Getting started with SAP PI/PO an overview presentation
Getting started with SAP PI/PO an overview presentationGetting started with SAP PI/PO an overview presentation
Getting started with SAP PI/PO an overview presentation
 
SPC Master Power User SharePoint & Office 365
SPC Master Power User SharePoint & Office 365SPC Master Power User SharePoint & Office 365
SPC Master Power User SharePoint & Office 365
 
SharePoint 2010 Developer 101
SharePoint 2010 Developer 101SharePoint 2010 Developer 101
SharePoint 2010 Developer 101
 
Where did design view go in SharePoint Designer
Where did design view go in SharePoint DesignerWhere did design view go in SharePoint Designer
Where did design view go in SharePoint Designer
 
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
 
Custom SharePoint 2010 solutions without server access
Custom SharePoint 2010 solutions without server accessCustom SharePoint 2010 solutions without server access
Custom SharePoint 2010 solutions without server access
 
Xml+messaging+with+soap
Xml+messaging+with+soapXml+messaging+with+soap
Xml+messaging+with+soap
 
ArcReady - Architecting For The Cloud
ArcReady - Architecting For The CloudArcReady - Architecting For The Cloud
ArcReady - Architecting For The Cloud
 
SharePoint and Open XML
SharePoint and Open XMLSharePoint and Open XML
SharePoint and Open XML
 

Último

Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
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 organizationRadu Cotescu
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
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 Nanonetsnaman860154
 
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.pptxHampshireHUG
 
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 2024Rafal Los
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 

Último (20)

Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
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
 
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
 
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
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 

Working With SharePoint Data and Queries

  • 1. Working With SharePoint DataOctober 8, 2009 Joseph Ackerman, Senior ConsultantMicrosoft Consulting Services, GICS, Dell Inc.joseph_ackerman@dell.com
  • 2. The Ever-Popular Intro Slide Joseph Ackerman (joseph_ackerman@dell.com) 20 + years of software development for clients of all sizes and shapes Wells Fargo Hewlett-Packard Aetna Visa Stanford University Currently consulting as part of Dell’s Microsoft Consulting Services Formerly Allin, Microsoft’s Northwest Region Partner of the Year 2008 Most recent project: internal systems for eBay
  • 3. Agenda What it’s not The big (overall) “why” SharePoint storage The SharePoint data object model The custom ListInfo web part The little (specific) “why” Finding what’s hidden Queries Summary and wrap-up
  • 4. What this talk is not It’s not about how to build web parts However, we will build some It’s not a CAML tutorial But we will discuss it and use it a bit It’s pretty much unavoidable It’s not a solution to all your SharePoint data woes We could spend days talking about this stuff and not cover everything Things are getting better, but any experienced developer will tell you that SharePoint is woefully under-documented for developers Your best bet is just to dig in and start working with it
  • 5. Why am I giving this talk? SharePoint is built on top of ASP.Net 2.0 SQL Server Easy stuff, Right? Yes…but! There are many differences between working with ASP.Net and SharePoint! One of the biggest differences is working with data stored in SharePoint. There is no ADO.Net Provider for SharePoint There is no (official) LINQ to SharePoint (yet!)
  • 6. Why am I giving this talk? Until the day Microsoft sees fit to provide us with simpler, easier to use tools, our best bet is to access data in SharePoint via The SharePoint Object Model CAML (more on this later) There’s Web Services too, but that’s another talk
  • 7. Lists, Lists and more Lists SharePoint stores all of its data in a construct called a List Conceptually, Lists are like Tables in a Database Columns are referred to as Fields Rows are referred to as ListItems However, Lists have a lot more meta data They are less flexible in some ways – some things we take for granted in a database (like joins, for example) are either difficult or impossible
  • 8. Where do we begin? In Context! You have to reference the SharePoint Libraries To communicate with SharePoint data, you have to have the proper context The SPContext object provides that for you If your code is in a web part you can use the “current” context The context object allows you to get the SPsite object (actually a “site collection”)
  • 9. Sites have webs The Site Collection has one or more webs, accessible through the AllWebs collection The default web for the collection is accessed with the OpenWeb() method Each web has a collection of lists of varying types (Custom Lists, Document Libraries, Picture Libraries, Task Lists, Announcements etc.) Each List has 1-to-n Views
  • 12. So, why do we need all this? First reason: SharePoint hides a bunch of stuff There are hidden lists There are hidden fields in the various list types Some built in methods don’t return everything For example SPList.Items.GetDataTable() Where are the rest of my fields?!
  • 14. So, why do we need all this? Second Reason: If you want to write queries to retrieve list items that meet specific criteria, you have to use CAML CAML queries use an XML syntax in place of SQL The field list in your query requires the use of the internal field names and their SharePoint Types There isn’t really a clean, simple, obvious place to find this information
  • 15. CAML Humps CAML, while useful, has some serious shortcomings: There’s a limited number of conditions and functions There’s a lot of details about fields you MUST know or you’ll spend a lot of time debugging: Internal field names SharePoint data types Data formats for things like dates and lookup values There’s no joins – you can get values from lookup fields but that’s it CAML queries are a real pain to use in code – you can write your own helper classes or you can use some that others have written, but the ultimate result will always be a string
  • 16. CAML Humps You can write your query as SQL and convert it by hand using the method found here: http://www.codeproject.com/KB/sharepoint/Sharepoint_CAML_query.aspx Or you can save yourself a lot of work by using other tools The U2U CAML Query Builder is VERY helpful
  • 17. CAML Query Web Part Demo
  • 18. Summary Learn and know the SharePoint data object model You may also want to learn the web services Familiarize yourself with CAML Use the available tools, and when necessary, build your own Learn to search the SharePoint blogs because the official documentation from Microsoft (even the SDK!) leaves much to be desired With apologies to Nike, “Just do it”
  • 19. Resources Tools U2U CAML Query Builder LINQ to SharePoint (CodePlex) Stramit CAML Viewer 2007 (CodePlex) Blogs Andrew Connell Heather Solomon http://www.sharepointblogs.com/ Books Professional SharePoint 2007 Web Content Management Development by Andrew Connell Microsoft SharePoint 2007 Development Unleashed by Kevin Hoffman and Robert Foster Developer's Guide to the Windows SharePoint Services v3 Platform by Todd Bleeker