I'm trying to execute a query on a custom list. I'm receiving a generic error that isn't helping me track down the problem.
Error Message:
Exception from HRESULT: 0x80131904
Stacktrace:
at Microsoft.SharePoint.Client.ClientRequest.ProcessResponseStream(Stream responseStream)
at Microsoft.SharePoint.Client.ClientRequest.ProcessResponse()
at Microsoft.SharePoint.Client.ClientRequest.ExecuteQueryToServer(ChunkStringBuilder sb)
at Microsoft.SharePoint.Client.ClientRequest.ExecuteQuery()
at Microsoft.SharePoint.Client.ClientRuntimeContext.ExecuteQuery()
at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery()
Relevant Code:
var timeHoursAgo = DateTime.Now.AddHours(ModifiedHours * -1);
string query = Camlex.Query().Where(
x => (string)x["IsAccessGranted"] == "Yes" &&
(DateTime)x["Modified"] >= timeHoursAgo)
.ToString();
var caml = new CamlQuery();
caml.ViewXml = string.Format("<View>{0}</View>", query);
Which produces a caml query like the following:
<View><Query>
<Where>
<And>
<Eq>
<FieldRef Name="IsAccessGranted" />
<Value Type="Text">Yes</Value>
</Eq>
<Geq>
<FieldRef Name="Modified" />
<Value Type="DateTime">2016-11-07T11:15:52Z</Value>
</Geq>
</And>
</Where>
</Query></View>
What are some causes of this error I should look for?