Using the SharePoint 2010 Managed Client Object Model – Asynchronous Processing

This is a clipboard friendly version of example #16, Asynchronous Processing, from Using the SharePoint 2010 Managed Client Object Model. This blog is inactive.New blog: EricWhite.com/blog Blog TOC using System;using System.Collections.Generic;using Microsoft.SharePoint.Client; class Program{    static void Main(string[] args)    {        AsynchronousAccess asynchronousAccess = new AsynchronousAccess();        asynchronousAccess.Run();        Console.WriteLine(“Before exiting Main”);        Console.WriteLine();        Console.WriteLine(“In a real application, the application can”);        Console.WriteLine(“continue to be responsive to the user.”);        Console.WriteLine();        Console.ReadKey();    }}…


Using the SharePoint 2010 Managed Client Object Model – Accessing Large Lists

This is a clipboard friendly version of example #15, Accessing Large Lists, from Using the SharePoint 2010 Managed Client Object Model. This blog is inactive.New blog: EricWhite.com/blog Blog TOC using System;using System.Linq;using Microsoft.SharePoint.Client; class Program{    static void Main()    {        ClientContext clientContext =            new ClientContext(“http://intranet.contoso.com”);         List list = clientContext.Web.Lists            .GetByTitle(“Client API Test List”);         // First, add 20 items to Client API…


Using the SharePoint 2010 Managed Client Object Model – Discovering the Schema for Fields

This is a clipboard friendly version of example #14, Discovering the Schema for Fields, from Using the SharePoint 2010 Managed Client Object Model. This blog is inactive.New blog: EricWhite.com/blog Blog TOC using System;using System.Linq;using System.Xml.Linq;using Microsoft.SharePoint.Client; class Program{    static void Main(string[] args)    {        ClientContext clientContext =            new ClientContext(“http://intranet.contoso.com”);        List list = clientContext.Web.Lists            .GetByTitle(“Client API Test List”);        clientContext.Load(list);        FieldCollection fields = list.Fields;        clientContext.Load(fields);        clientContext.ExecuteQuery();        foreach (var f…


Using the SharePoint 2010 Managed Client Object Model – Delete a List

This is a clipboard friendly version of example #13, Delete a List, from Using the SharePoint 2010 Managed Client Object Model. This blog is inactive.New blog: EricWhite.com/blog Blog TOC using System;using Microsoft.SharePoint.Client; class DisplayWebTitle{    static void Main()    {        ClientContext clientContext =            new ClientContext(“http://intranet.contoso.com”);        clientContext.Web.Lists.GetByTitle(“Client API Test List”)            .DeleteObject();        clientContext.ExecuteQuery();    }} Following is the same example using fully qualified names for better discoverability. using…


Using the SharePoint 2010 Managed Client Object Model – Deleting Client Objects

This is a clipboard friendly version of example #12, Deleting Client Objects, from Using the SharePoint 2010 Managed Client Object Model. This blog is inactive.New blog: EricWhite.com/blog Blog TOC using System;using System.Linq;using System.Collections.Generic;using Microsoft.SharePoint.Client; class Program{    static void Main(string[] args)    {        ClientContext clientContext = new ClientContext(“http://intranet.contoso.com”);        List list = clientContext.Web.Lists.GetByTitle(“Client API Test List”);        CamlQuery camlQuery = new CamlQuery();        camlQuery.ViewXml =            @”<View>                <Query>                  <Where>                    <Eq>                      <FieldRef Name=’Category’/>                      <Value…


Using the SharePoint 2010 Managed Client Object Model – Updating Client Objects

This is a clipboard friendly version of example #11, Updating Client Objects, from Using the SharePoint 2010 Managed Client Object Model. This blog is inactive.New blog: EricWhite.com/blog Blog TOC using System;using Microsoft.SharePoint.Client; class Program{    static void Main(string[] args)    {        ClientContext clientContext =            new ClientContext(“http://intranet.contoso.com”);        List list = clientContext.Web.Lists            .GetByTitle(“Client API Test List”);        CamlQuery camlQuery = new CamlQuery();        camlQuery.ViewXml =            @”<View>                <Query>                  <Where>                    <Eq>                      <FieldRef Name=’Category’/>                      <Value Type=’Text’>Development</Value>                    </Eq>                  </Where>                </Query>                <RowLimit>100</RowLimit>              </View>”;        ListItemCollection listItems =…


Using the SharePoint 2010 Managed Client Object Model – Filtering the Child Collection returned by LoadQuery using LINQ

This is a clipboard friendly version of example #10, Filtering the Child Collection returned by LoadQuery using LINQ, from Using the SharePoint 2010 Managed Client Object Model. This blog is inactive.New blog: EricWhite.com/blog Blog TOC using System;using System.Linq;using System.Collections.Generic;using Microsoft.SharePoint.Client; class Program{    static void Main(string[] args)    {        ClientContext clientContext =            new ClientContext(“http://intranet.contoso.com”);        ListCollection listCollection = clientContext.Web.Lists;        IEnumerable<List> hiddenLists = clientContext.LoadQuery(            listCollection                .Where(list =>…


Using the SharePoint 2010 Managed Client Object Model – Increasing Performance by Nesting Includes in LoadQuery

This is a clipboard friendly version of example #9, Increasing Performance by Nesting Includes in LoadQuery, from Using the SharePoint 2010 Managed Client Object Model. This blog is inactive.New blog: EricWhite.com/blog Blog TOC using System;using System.Collections.Generic;using Microsoft.SharePoint.Client; class Program{    static void Main()    {        ClientContext clientContext =            new ClientContext(“http://intranet.contoso.com”);        IEnumerable<List> lists = clientContext.LoadQuery(            clientContext.Web.Lists.Include(                list => list.Title,                list => list.Hidden,                list => list.Fields.Include(                    field => field.Title,                    field…


Using the SharePoint 2010 Managed Client Object Model – Using the LoadQuery Method

This is a clipboard friendly version of example #8, Using the LoadQuery Method, from Using the SharePoint 2010 Managed Client Object Model. This blog is inactive.New blog: EricWhite.com/blog Blog TOC using System;using System.Collections.Generic;using Microsoft.SharePoint.Client; class Program{    static void Main(string[] args)    {        ClientContext clientContext =            new ClientContext(“http://intranet.contoso.com”);        Web site = clientContext.Web;        ListCollection lists = site.Lists;        IEnumerable<List> newListCollection = clientContext.LoadQuery(            lists.Include(                list => list.Title,                list => list.Id,                list…


Using the SharePoint 2010 Managed Client Object Model – Filtering the Child Collection returned by Load using LINQ

This is a clipboard friendly version of example #7, Filtering the Child Collection returned by Load using LINQ, from Using the SharePoint 2010 Managed Client Object Model. This blog is inactive.New blog: EricWhite.com/blog Blog TOC using System;using System.Linq;using Microsoft.SharePoint.Client; class Program{    static void Main(string[] args)    {        ClientContext clientContext =            new ClientContext(“http://intranet.contoso.com”);        ListCollection listCollection = clientContext.Web.Lists;        clientContext.Load(            listCollection,            lists => lists                .Include(                    list => list.Title,                    list =>…