Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

Below is the code:

        ClientContext context = new ClientContext("http://SPSite");
        context.Credentials = new NetworkCredential("user", "pwd", "domain");
        ChangeQuery cq = new ChangeQuery(true, true);                  
        ChangeCollection col = list.GetChanges(cq);            
        context.Load(col);
        context.ExecuteQuery();
        MessageBox.Show(col.Count.ToString());

Irrespective of the changes done, it always shows 0.

share|improve this question
1  
@varg How is sharepoint-clientobject not relevant here? – Rawling Oct 10 '12 at 7:41
@Rawling my fault, because the tag isn't really popular. reedited the keywords. – varg Oct 10 '12 at 7:58
1  
There are server object model and client object mode. So, "sharepoint-clientobject" would be appropriate is what is feel. I am a newbie idon't know. – Srikanth P Vasist Oct 10 '12 at 8:01

1 Answer

up vote 0 down vote accepted
ClientContext context = new ClientContext("http://SPSite");
context.Credentials = new NetworkCredential("user", "pwd", "domain");
ChangeQuery cq = new ChangeQuery(true, true); 
cq.ChangeTokenStart = new ChangeToken();
cq.ChangeTokenStart.StringValue = "1;3;" + list.Id.ToString() + ";" + DateTime.UtcNow.AddHours(-1).Ticks.ToString() + ";-1";                 
ChangeCollection col = list.GetChanges(cq);            
context.Load(col);
context.ExecuteQuery();
MessageBox.Show(col.Count.ToString());

Even though I don't prefer creating token by yourself, this seems to be the only way which works as per my googling so far.

share|improve this answer

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.