SlideShare a Scribd company logo
1 of 38
Download to read offline
Hard learned SharePoint dev tips
SAHIL MALIK
WWW.WINSMARTS.COM
@SAHILMALIK

SHAREPOINT AND PROJECT CONFERENCE ADRIATICS 2013
ZAGREB, NOVEMBER 27-28 2013
sponsors
C:>whoami

11xMVP
15xAuthor
Pluralsight Author
Microsoft Metro Trainer
Funny and Honest

HTTP://BLAH.WINSMARTS.COM
@SAHILMALIK
Hard learned SharePoint dev tips
0945AM

Hard learned CSOM and REST

0345PM
Lists and Document Libraries
Lists live in SPWebs
dbo.AllLists
Primary Key for AllLists
Content Types – will make performance worse
tp_Fields
dbo.AllUserData
My Test List
Example
Example 2
tp_ColumnSet
Sparse Columns
AllUserData
tp_ID

identify the list item

tp_GUID

To uniquely identify the list item

tp_ListId

To identify which list the item belongs to.

tp_SiteId

To identify which site the item belongs to. It is the value of ‘Id’ in ‘AllSites’ table

tp_RowOrdinal

Zero based ordinal index in the set of rows representing the list item

tp_Author

User who created the list item

tp_Editor

User who last edited the list item

tp_Modified

Modified date

tp_Created

Created date

tp_DeleteTransactionID

Not 0x if the item is in recycle bin

tp_IsCurrentVersion (bit)

1 or 0, identifying latest version

nvarchar1..64

Stores values of application fields of type nvarchar

ntext1..32

Stores application fields of type ntext

bit1..16

Application fields of type bit

datetime1..8

Application fields of type datetime
AllUserData
float 1..12

Application fields of type float

Int1..16

Application fields of type int

sql_variant1..8

Application fields of type sql_variant
AllUserData - takeaways
Now lets talk documents!
Test Data
How are documents stored?
Document Storage
DocStreams
Scientifically accurate picture of RBS
Document Storage – Lessons Learnt
Careful of iterators!

Avoids multiple calls to DB
Does not create SPListItemCollection over and over again
Number of Items in a list
SPQuery is your friend
2147483648

And its getting every single column!
Avoid reloading objects
SharePoint objects are not threadsafe!
Getting a list
proc_EnumLists
proc_MapUrlToListAndView
proc_EnumLists loads all information of all lists in the SPWeb object, and then does a .Title comparison to find the
list you need.
proc_MapUrlToListAndView finds the GUID for the associated list, and then loads the metadata for the list you
need.
Deleting Items
Good vs Evil
Evil

Good

SPList.Items.Count

SPList.ItemsCount

SPList.Items[Guid]

SPList.GetItemByUniqueId(Guid)

SPList.Items[Int32]

SPList.GetItemById(Int32)

SPList.Items.GetItemById(Int32)

SPList.GetItemById(Int32

SPList.Items.NumberOfFields

SPQuery + ViewFields

SPList.Items.ReorderItems

Use SPQuery.ListItemCollectionPosition to do paging

SPFolder.Files.Count

SPFolder.ItemCount
.Dispose
.Dispose
questions?
HTTP://BLAH.WINSMARTS.COM
@SAHILMALIK
thank you.
SHAREPOINT AND PROJECT CONFERENCE ADRIATICS 2013
ZAGREB, NOVEMBER 27-28 2013

More Related Content

Viewers also liked

Viewers also liked (6)

To the cloud!
To the cloud!To the cloud!
To the cloud!
 
Project Server - Who can benefit from it and how?
Project Server - Who can benefit from it and how?Project Server - Who can benefit from it and how?
Project Server - Who can benefit from it and how?
 
Driving Social Business Transformation with The Microsoft Platform - Symon Ga...
Driving Social Business Transformation with The Microsoft Platform - Symon Ga...Driving Social Business Transformation with The Microsoft Platform - Symon Ga...
Driving Social Business Transformation with The Microsoft Platform - Symon Ga...
 
Solving Real World Challenges with Enterprise Search
Solving Real World Challenges with Enterprise SearchSolving Real World Challenges with Enterprise Search
Solving Real World Challenges with Enterprise Search
 
SharePoint Insanity Demystified
SharePoint Insanity DemystifiedSharePoint Insanity Demystified
SharePoint Insanity Demystified
 
Assuring the code quality of share point solutions and apps - Matthias Einig
Assuring the code quality of share point solutions and apps - Matthias EinigAssuring the code quality of share point solutions and apps - Matthias Einig
Assuring the code quality of share point solutions and apps - Matthias Einig
 

Similar to Hard learned SharePoint development tips

Design And Implementation Of Web Service Testing Framework Mit Template
Design And Implementation Of Web Service Testing Framework Mit TemplateDesign And Implementation Of Web Service Testing Framework Mit Template
Design And Implementation Of Web Service Testing Framework Mit Template
reswin
 
Breaking down data silos with the open data protocol
Breaking down data silos with the open data protocolBreaking down data silos with the open data protocol
Breaking down data silos with the open data protocol
Woodruff Solutions LLC
 
Statements,joins and operators in sql by thanveer danish melayi(1)
Statements,joins and operators in sql by thanveer danish melayi(1)Statements,joins and operators in sql by thanveer danish melayi(1)
Statements,joins and operators in sql by thanveer danish melayi(1)
Muhammed Thanveer M
 

Similar to Hard learned SharePoint development tips (20)

MuleSoft London Community February 2020 - MuleSoft and OData
MuleSoft London Community February 2020 - MuleSoft and ODataMuleSoft London Community February 2020 - MuleSoft and OData
MuleSoft London Community February 2020 - MuleSoft and OData
 
Design And Implementation Of Web Service Testing Framework Mit Template
Design And Implementation Of Web Service Testing Framework Mit TemplateDesign And Implementation Of Web Service Testing Framework Mit Template
Design And Implementation Of Web Service Testing Framework Mit Template
 
Linq
LinqLinq
Linq
 
Everything you wanted to know about Dublin Core metadata
Everything you wanted to know about Dublin Core metadataEverything you wanted to know about Dublin Core metadata
Everything you wanted to know about Dublin Core metadata
 
Hatkit Project - Datafiddler
Hatkit Project - DatafiddlerHatkit Project - Datafiddler
Hatkit Project - Datafiddler
 
Breaking down data silos with the open data protocol
Breaking down data silos with the open data protocolBreaking down data silos with the open data protocol
Breaking down data silos with the open data protocol
 
Engineering Student MuleSoft Meetup#6 - Basic Understanding of DataWeave With...
Engineering Student MuleSoft Meetup#6 - Basic Understanding of DataWeave With...Engineering Student MuleSoft Meetup#6 - Basic Understanding of DataWeave With...
Engineering Student MuleSoft Meetup#6 - Basic Understanding of DataWeave With...
 
Ruby on Rails introduction
Ruby on Rails introduction Ruby on Rails introduction
Ruby on Rails introduction
 
Dynamic Language Performance
Dynamic Language PerformanceDynamic Language Performance
Dynamic Language Performance
 
Linq
LinqLinq
Linq
 
Linq
LinqLinq
Linq
 
Introduction to thymeleaf
Introduction to thymeleafIntroduction to thymeleaf
Introduction to thymeleaf
 
Of Lambdas and LINQ
Of Lambdas and LINQOf Lambdas and LINQ
Of Lambdas and LINQ
 
Wcf data services
Wcf data servicesWcf data services
Wcf data services
 
Dublin Core, the DCMI Abstract Model & DC Application Profiles
Dublin Core, the DCMI Abstract Model & DC Application ProfilesDublin Core, the DCMI Abstract Model & DC Application Profiles
Dublin Core, the DCMI Abstract Model & DC Application Profiles
 
The Glory of Rest
The Glory of RestThe Glory of Rest
The Glory of Rest
 
BCA IPU VB.NET UNIT-II
BCA IPU VB.NET UNIT-IIBCA IPU VB.NET UNIT-II
BCA IPU VB.NET UNIT-II
 
Architecture | Busy Java Developers Guide to NoSQL | Ted Neward
Architecture | Busy Java Developers Guide to NoSQL | Ted NewardArchitecture | Busy Java Developers Guide to NoSQL | Ted Neward
Architecture | Busy Java Developers Guide to NoSQL | Ted Neward
 
Statements,joins and operators in sql by thanveer danish melayi(1)
Statements,joins and operators in sql by thanveer danish melayi(1)Statements,joins and operators in sql by thanveer danish melayi(1)
Statements,joins and operators in sql by thanveer danish melayi(1)
 
Hard learned CSOM and REST tips
Hard learned CSOM and REST tipsHard learned CSOM and REST tips
Hard learned CSOM and REST tips
 

More from SPC Adriatics

More from SPC Adriatics (20)

How to secure your data in Office 365
How to secure your data in Office 365 How to secure your data in Office 365
How to secure your data in Office 365
 
Do you know, where your sensitive data is?
Do you know, where your sensitive data is?Do you know, where your sensitive data is?
Do you know, where your sensitive data is?
 
Securing Intellectual Property using Azure Rights Management Services
Securing Intellectual Property using Azure Rights Management ServicesSecuring Intellectual Property using Azure Rights Management Services
Securing Intellectual Property using Azure Rights Management Services
 
Creating Workflows in Project Online
Creating Workflows in Project OnlineCreating Workflows in Project Online
Creating Workflows in Project Online
 
Faster than a flash behind the scenes of patching SharePoint Online
Faster than a flash   behind the scenes of patching SharePoint OnlineFaster than a flash   behind the scenes of patching SharePoint Online
Faster than a flash behind the scenes of patching SharePoint Online
 
Role based views in Project and Resource Center
Role based views in Project and Resource CenterRole based views in Project and Resource Center
Role based views in Project and Resource Center
 
OneDrive, TwoDrive, Whiterive, BlueDrive (hahaha)
OneDrive, TwoDrive, Whiterive, BlueDrive (hahaha)OneDrive, TwoDrive, Whiterive, BlueDrive (hahaha)
OneDrive, TwoDrive, Whiterive, BlueDrive (hahaha)
 
SharePoint Governance and Compliance
SharePoint Governance and ComplianceSharePoint Governance and Compliance
SharePoint Governance and Compliance
 
From analyses to successful Implementation
From analyses to successful ImplementationFrom analyses to successful Implementation
From analyses to successful Implementation
 
The key to a successful Office 365 implementation is adoption
The key to a successful Office 365 implementation is adoptionThe key to a successful Office 365 implementation is adoption
The key to a successful Office 365 implementation is adoption
 
Office 365 Video
Office 365 VideoOffice 365 Video
Office 365 Video
 
10 Steps to be Successful with Enterprise Search
10 Steps to be Successful with Enterprise Search10 Steps to be Successful with Enterprise Search
10 Steps to be Successful with Enterprise Search
 
How the Cloud Changes Business Solution Design and Delivery
How the Cloud Changes Business Solution Design and DeliveryHow the Cloud Changes Business Solution Design and Delivery
How the Cloud Changes Business Solution Design and Delivery
 
Scaling SharePoint 2016 Farms with MinRole & Other Tools
Scaling SharePoint 2016 Farms with MinRole & Other ToolsScaling SharePoint 2016 Farms with MinRole & Other Tools
Scaling SharePoint 2016 Farms with MinRole & Other Tools
 
SharePoint 2013 Search Operations
SharePoint 2013 Search OperationsSharePoint 2013 Search Operations
SharePoint 2013 Search Operations
 
Office Online Server 2016 - a must for on-premises installation for SharePoin...
Office Online Server 2016 - a must for on-premises installation for SharePoin...Office Online Server 2016 - a must for on-premises installation for SharePoin...
Office Online Server 2016 - a must for on-premises installation for SharePoin...
 
Custom Code-The Missing Piece of the SharePoint Governance Puzzle
Custom Code-The Missing Piece of the SharePoint Governance PuzzleCustom Code-The Missing Piece of the SharePoint Governance Puzzle
Custom Code-The Missing Piece of the SharePoint Governance Puzzle
 
SharePoint 2016 Hybrid Sites Inside Out
SharePoint 2016 Hybrid Sites Inside OutSharePoint 2016 Hybrid Sites Inside Out
SharePoint 2016 Hybrid Sites Inside Out
 
Microsoft BI demystified: SharePoint 2016 BI or for PowerBI v2?
Microsoft BI demystified: SharePoint 2016 BI or for PowerBI v2?Microsoft BI demystified: SharePoint 2016 BI or for PowerBI v2?
Microsoft BI demystified: SharePoint 2016 BI or for PowerBI v2?
 
What's New for the BI workload in SharePoint 2016 and SQL Server 2016
What's New for the BI workload in SharePoint 2016 and SQL Server 2016What's New for the BI workload in SharePoint 2016 and SQL Server 2016
What's New for the BI workload in SharePoint 2016 and SQL Server 2016
 

Recently uploaded

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
Enterprise Knowledge
 

Recently uploaded (20)

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
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
 
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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
[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
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
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
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
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
 
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
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
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
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

Hard learned SharePoint development tips