【发布时间】:2016-04-29 20:30:58
【问题描述】:
我正在使用 Odata RESTful 服务读取 Sharepoint 列表数据(>20000 个条目),详见此处 -http://blogs.msdn.com/b/ericwhite/archive/2010/12/09/getting-started-using- the-odata-rest-api-to-query-a-sharepoint-list.aspx
我能够读取数据,但我只能获得前 1000 条记录。我还检查了共享点服务器上的 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
【问题讨论】:
标签: odata