title: Should I use SPContext or ClientContext?
body: <p>I need to extract data from a SharePoint Online list in a simple Console application (.net 4.5).<br>
  For this, I have added a reference to <code>Microsoft.SharePoint.Client</code> and <code>Microsoft.SharePoint.Client.Runtime</code>.<br>
  The following does what I need...</p>
  
  <pre><code>ClientContext ctx = new ClientContext(siteUrl);
  ctx.Credentials = new SharePointOnlineCredentials(siteUser, securePass);
  
  Web site = ctx.Web;
  ctx.Load(site);
  List lst = site.Lists.GetByTitle("SomeList");
  CamlQuery query = new CamlQuery();
  query.ViewXml = @"&lt;View&gt;
                      &lt;ViewFields&gt;
                          &lt;FieldRef Name='Title' /&gt;
                      &lt;/ViewFields&gt;
                  &lt;/View&gt;";
  
  ListItemCollection items = lst.GetItems(query);
  ctx.Load(items);
  ctx.ExecuteQuery();
  foreach (var item in items)
  {
      Console.WriteLine(item["Title"]);
  }
  </code></pre>
  
  <p>I now need some more complex query with a <code>Query</code> and a <code>RowLimit</code>. In this more complex <code>CamlQuery</code>, <code>RowLimit</code> seems to be ignored.</p>
  
  <pre><code>&lt;View&gt;
      &lt;RowLimit&gt;1000&lt;/RowLimit&gt;   
      &lt;ViewFields&gt;
        &lt;FieldRef Name='Title' /&gt;
        &lt;FieldRef Name='ProductName' /&gt;
        &lt;FieldRef Name='GroupName' /&gt;
      &lt;/ViewFields&gt;
      &lt;Query&gt;
        &lt;Where&gt;
            &lt;Neq&gt;
                &lt;FieldRef Name='GroupName' /&gt;
                &lt;Value Type='Lookup'&gt;&lt;/Value&gt;
            &lt;/Neq&gt;
        &lt;/Where&gt;
      &lt;/Query&gt;
  &lt;/View&gt;
  </code></pre>
  
  <p>I can't get the RowLimit to work. All examples I come across are using SPContext that has the ability to set the RowLimit on a SPQuery object.</p>
  
  <p>The SPContext needs a large SharePoint dll to work while ClientContext is already present in Visual Studio (using 2015) and has much smaller DLL's.</p>
  
  <p>So..</p>
  
  <p><strong>1. When should I use SPContext?<br>
   2. Is there some reason that RowLimit does not work in the CamlQuery above?</strong></p>
  
  <p><strong>Edit 13/08 13:15</strong><br>
  The problem does not seem to be with the RowLimit but with the query itself.</p>
  
  <pre><code>&lt;Neq&gt;
      &lt;FieldRef Name='GroupName' /&gt;
      &lt;Value Type='Lookup'&gt;&lt;/Value&gt;
  &lt;/Neq&gt;
  </code></pre>
  
  <p>This does not seem to work...</p>