我正在使用Odata RESTful服务阅读Sharepoint列表数据(> 20000个条目),详见此处-http://blogs.msdn.com/b/ericwhite/archive/2010/12/09/getting-started-using-the-odata -rest-API - 查询-A-SharePoint的list.aspx
我能够读取数据,但我只获得前1000条记录.我还检查了Sharepoint服务器上的List View Throttling设置为5000.好心提醒.
更新:
@Turker:你的答案就是现场!! 非常感谢你.我能够在第一次迭代中获得前2000条记录.但是,我在while循环的每次迭代中获得相同的记录.我的代码如下 -
...initial code...
int skipCount =0;
while (((QueryOperationResponse)query).GetContinuation() != null)
{
//query for the next partial set of customers
query = dc.Execute<CATrackingItem>(
((QueryOperationResponse)query).GetContinuation().NextLinkUri
);
//Add the next set of customers to the full list
caList.AddRange(query.ToList());
var results = from d in caList.Skip(skipCount)
select new
{
Actionable = Actionable,
}; Created = d.Created,
foreach (var res in results)
{
structListColumns.Actionable = res.Actionable;
structListColumns.Created= res.Created;
}
skipCount = caList.Count;
}//Close of while loop
Run Code Online (Sandbox Code Playgroud)
小智 6
你<link rel="next">在饲料的末尾看到了一个元素吗?
例如,如果你看一下
http://services.odata.org/Northwind/Northwind.svc/Customers/
你会看见
<link rel="next" href="http://services.odata.org/Northwind/Northwind.svc/Customers/?$skiptoken='ERNSH'" />
Run Code Online (Sandbox Code Playgroud)
在feed的末尾,这意味着服务正在实现服务器端分页,你需要发送
http://services.odata.org/Northwind/Northwind.svc/Customers/?$skiptoken='ERNSH'
Run Code Online (Sandbox Code Playgroud)
查询以获取下一组结果.