Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have this code :

ClientContext clientContext = new ClientContext(this.siteURL);
List oList = clientContext.Web.Lists.GetByTitle("AList");

I cant seem to access any properties for oList, is there a way to tell that the clientContext object is connected to sharepoint?

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

Have you done clientContext.Load(oList) ?

share|improve this answer
    
No, do I need to do that? –  user879 Dec 14 '10 at 12:38
    
yep, you need to initialize the context with whatever objects you want to have instantiated when you run ExecuteQuery/Async. –  James Love Dec 14 '10 at 14:41
    
To be fair Microsoft have tried to document this on MSDN. I still think the objects should have more closely resembled stuff like ado.net, but I think once I get more into clientContext it will start making sense! thanks again. –  user879 Dec 15 '10 at 8:26
add comment

Your Answer

 
discard

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.