SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am running a very simple Console Application to test SharePoint 2010 client object model. Here is the code

using System;
using Microsoft.SharePoint.Client;

class Program
    static void Main()
        ClientContext clientContext =
            new ClientContext("");
        List list = clientContext.Web.Lists
        Console.WriteLine("List Title: {0}", list.Title);
        CamlQuery camlQuery = new CamlQuery();
        camlQuery.ViewXml = "<View/>";
        ListItemCollection listItems = list.GetItems(camlQuery);
        foreach (ListItem listItem in listItems)
            Console.WriteLine("Id: {0} Title: {1}",
                oListItem.Id, listItem["Title"]);

The problem is everything works fine. It just that the rows are not retrieved from any list or library. The collection is always empty even if there is data in actual list.

Any ideas ?

This example is exact copy paste from MSDN

share|improve this question
Does the "List Title: {0}" print anything? – Russell Jan 2 '12 at 22:23
No, it does not go into loop. I found it, it was due to insufficient permissions. – Madhur Ahuja Jan 3 '12 at 5:07
up vote 1 down vote accepted

Strangely, this was caused by insufficient permissions.

share|improve this answer

Really strange!! I can't find any mistake in should work.

Hope you ran Visual Studio with Run As Admin attribute..?

share|improve this answer
Its correct now. See my other answer. It was caused due to insufficient permissions. – Madhur Ahuja Jan 3 '12 at 9:28
Thanks for sharing. – NICK Jan 3 '12 at 10:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.