Thursday, October 31, 2013

Client object Model managed Code C# SharePoint



using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint.Client;

namespace SPClient.NetConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            ClientContext clientContext = new ClientContext("http://igtehydzbnv02:8811/");
            Web site = clientContext.Web;
            List list = site.Lists.GetByTitle("TestListFilter");
            CamlQuery query = new CamlQuery();

            ListItemCollection itemColl = list.GetItems(query);


            clientContext.Load(itemColl);
            clientContext.ExecuteQuery();
            Console.WriteLine("Count: {0}", itemColl.Count);


            for (int i = 0; i < itemColl.Count; i++)
            {
                Console.WriteLine(itemColl[i]["Title"]);
            }
            Console.ReadLine();

        }
    }
}

No comments:

Post a Comment

Seven steps to build and deploy SPFX web part to SharePoint

Install Node.JS Use this link to install Node.JS https://nodejs.org/en/ 2.        Install yeomen and gulp CMD>npm install –g y...