我正在尝试运行ClientContext.ExecuteQuery()
,但收到以下错误消息:
“底层连接已关闭:预期保持活动的连接已被服务器关闭。” >> “无法从传输连接读取数据:现有连接被远程主机强行关闭。”
我的代码如下:
ClientContext _clientcontext = new ClientContext("<URL of sharepoint site>");
NetworkCredential _cred = new NetworkCredential("userid", "password", "domain");
_clientcontext.Credentials = _cred;
Web _site = _clientcontext.Web;
CamlQuery _query = new CamlQuery();
try
{
_query.ViewXml = <View><Where><Eq><FieldRef Name=\"Created\"/><Value Type=\"DateTime\"><Today OffsetDays=\"-4\"/></Value></Eq></Where></View>";
List _splist = _site.Lists.GetById(new Guid("<GUID>"));
ListItemCollection _listitems = _splist.GetItems(_query);
_clientcontext.Load(_listitems);
_clientcontext.ExecuteQuery();