I'm trying to printOut some items from a ListItem. But when run the code I get following exception:
"Invalid usage of query execution. The query should be executed by using ExecuteQuery method on the client context object".
This is the code Block:
static void Main(string[] args)
{
try
{
ClientContext _clientContext = new ClientContext("http://spweb.reply.eu/sites/RC1/1003/");
_clientContext.Credentials = new NetworkCredential("mossuser","Reply.96","replynet");
SP.List list = _clientContext.Web.Lists.GetByTitle("Contenuti");
CamlQuery query = new SP.CamlQuery();
query.ViewXml = "@<View><Query><Where><Eq><FieldRef Name='tt_network_id' /><Value Type='Text'>clu_noe</Value></Eq></Where></Query></View>";
var itemts= list.GetItems(query);
_clientContext.Load(itemts);
_clientContext.ExecuteQuery();
Console.Write(itemts.Count().ToString());
}
catch (Exception e)
{
Console.Write(e.Message);
}
}