Skip to main content

Cloud

Client Object Model with SharePoint 2010

SharePoint 2007 didn’t have any client object model; as a result, only the server side api could be used to access SharePoint data when creating a Windows, WPF, Console, Silverlight or ASP.NET applications.
SharePoint 2010 now provides the infrasctucture to easily use SharePoint data from those client applications thanks to the client object model. You can now have your client applications easily access SharePoint properties, Lists and Document Libraries eventhough those client applicaitons might not be running from a SharePoint server or a SharePoint site.
Here is a quick example of obtaining SharePoint groups using the client object model

First, make sure you add the following two references to your project:

Also make sure you add the following using statement in your code:

Here, I am creating a new client context to my SharePoint site:

I am then querying all the avaibable SharePoint groups in that site and bind the returned results to my control:

The WPF application now shows all the SharePoint groups available in that site:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

PointBridge Blogs

More from this Author

Follow Us
TwitterLinkedinFacebookYoutubeInstagram