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 Share Point Data

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 Share Point Data (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

Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
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 WorkerThousandEyes
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 

Último (20)

Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
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
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 

Working With Share Point Data

  • 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