I am using C#.Net to query Sharepoint site. I am able to return all the data I need except ONE field, which the culprit seems to be due to it is a calculated field so it does not "exist" in my query results.
I have calculated field called hours worked, how can I query that field and return the results in my below syntax?
This is how I query:
string server = "blahblahblah";
string msn = "14318";
var ctx = new ClientContext(server);
ver web = ctx.Web;
List list = web.Lists.GetByTitle("Attendance");
CamlQuery camlQuery = new CamlQuery();
camlQuery.ViewXml = "<where><Eq><FieldRef Name='EmployeeID' /><Value Type='Text'>"+msn+"</Value></Eq><Where>";
var listItemCollection = list.GetItems(CamlQuery.CreateAllItemsQuery());
ctx.Load(listItemCollection, eachItem => eachItem.Include(
item => item,
item => item["recID"],
item => item["MasterID"]));
ctx.ExecuteQuery();
foreach (ListItem li in listItemCollection)
{
Console.WriteLine(li["recID"]);
Console.WriteLine(li["MasterID"]);
}