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 getting this error and from what I understand this is when you try and access columns from the list item. I have tried various things including the line below:

clientContext.Load(items, eachItem => eachItem.Include(item => item,item => item["Name"]));

I started off using this code. All of these resulted in the same error message:

The property or field has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested

Here is my code that I'm currently using just to try and work out what is going on. The list I'm trying to access is a standard Picture Library, and I just need to the access the Name of the image so I can construct a url to the image.

        string server = "http://myserver/path/path";
        var context = new ClientContext(server);
        var web = context.Web;
        var list = web.Lists.GetByTitle("Photos");
        var listItemCollection = list.GetItems(CamlQuery.CreateAllItemsQuery());



        foreach (ListItem listItem in listItemCollection)
            Console.WriteLine(listItem.FieldValuesAsText["Name"]); // Also tried listItem.DisplayName and File.Name
share|improve this question

Try this:


If you want to work with the DisplayName, you should do it like this:

ctx.Load(listItemCollection, items => items.IncludeWithDefaultProperties(item => item.DisplayName));

The following link should help you out:

share|improve this answer
I actually started off with this one and I had the same problem from what I remember. Will try again when back on my dev machine. Thanks – Andrew Aug 6 '12 at 8:15
Should Title just be available without passing anything additional to .load()? – Andrew Aug 6 '12 at 18:49
Yes that's right. Have a look here: – Vardhaman Deshpande Aug 6 '12 at 19:09
So I can now return a full list with DisplayName, But as soon as I introduce a simple camlquery to filter on the DisplayName I get back to the same error as before.. query to follow. I have tried with and without viewfields – Andrew Aug 6 '12 at 20:06
query.ViewXml = "<View><Query><Where><Eq><FieldRef Name='DisplayName'/>" + "<Value Type='Text'>" + contactId + "</Value></Eq></Where></Query>" + "<ViewFields>" + "<FieldRef Name='DisplayName' />" + "</ViewFields></View>"; – Andrew Aug 6 '12 at 20:07

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.