Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. 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
    
Has your connecting user account got enough rights to actually see/read the data? Update; there seem to be others with the same problem, no solution mentioned: social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/… –  Jasper Oct 10 '12 at 8:48
    
Yes, it has. Even I went through the link mentioned and felt the same as not to modify the stored procedure. –  Srikanth P Vasist Oct 10 '12 at 9:17
    
I agree on not modifying it. But in that case, I can't help you either. Sorry! –  Jasper Oct 10 '12 at 13:44
add comment

2 Answers 2

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);                
ChangeCollection col = list.GetChanges(cq);            
context.Load(col);
context.ExecuteQuery();
ChangeToken endToken;
foreach(Change change in col)
{
 endToken = change.ChangeToken;// endToken serves as next start token for further logs.
// Do your stuffs here.
}

This can be the appropriate solution.

share|improve this answer
add comment
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
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.