Approaches to Access SharePoint Data Programmatically (Part 1)

Microsoft SharePoint Server 2010 introduces several new approaches to interact with SharePoint Data . LINQ to SharePoint feature allow to build complex query with user friendly LINQ syntax , also both CAML and LINQ to SharePoint support join predictae in queries.one of major evolutions in SharePoint 2010 is the blurring of the distinction, between internal and external data.we can use many of the same techniques to query extenal data.

SPQuery and SPSiteDataQuery classes support submitting queries in CAML syntacs, in SharePoint 2010 CAML support JOIN predicate in queries ,also SPQuery class is using to query external list and the result are non-type items.

2- LINQ to SharePoint

SharePoint 2010 allows you to use LINQ queries to perform data operations on SharePoint Data. LINQ to SharePoint works against strongly typed entities . There is a command-line tool in SharePoint 2010 called SPMETAL that we can use to generate thses entities. internally , the LINQ to SharePoint provider generates the underlying CAML queries that perform data operations.

3-Business Connectivity services (BCS) object model

BCS object model enable us to ineract with external data .

In Next Part (Part 2), i’ll explain Query Classes (SPSiteDataQuery and SPQuery classes ) in details and what are the best practices of using these classes .

the following screenshot is taken from MSDN , this screenshot illustrate the usage of using each of Queries classes , LINQ to SharePoint , and BCS Object Model