O'Reilly logo

Microsoft SharePoint 2010 Development Cookbook by Ed Musters

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Retrieving data using LINQ to SharePoint

You can write a book on LINQ. Many books, in fact, have been written on LINQ. I suggest you seek out 101 LINQ Samples on MSDN to get a feel for the vaguely SQL-like syntax for querying data. You can use LINQ to query just about anything, as Microsoft has "providers" for SQL data, XML, objects, and now…. SharePoint! The role of the provider is to translate the LINQ query into the "native" query format in the case of SharePoint that is actually CAML (Collaborative Application Markup Language).

But to use LINQ against SharePoint, you need a "data context" - physically a C# class that is generated from the data source - meaning in our case the SharePoint lists in your site. There is a command-line utility called ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required