here I am trying to Access the ows_owshiddenversion i.e Hidden property of sharepoint calendar list as like below code.
CamlQuery camlQuery = new CamlQuery();
camlQuery.ViewXml = "<View><Query><Where>" +
"<DateRangesOverlap><FieldRef Name=\"EventDate\" />" +
"<FieldRef Name=\"EndDate\" />" +
"<FieldRef Name=\"RecurrenceID\"/>" +
"<Value Type=\"DateTime\"><Now /></Value></DateRangesOverlap>" +
"</Where></Query></View>";
ListItemCollection collListItem = oList.GetItems(camlQuery);
clientContext.Load(collListItem);
clientContext.ExecuteQuery();
foreach (ListItem oListItem in collListItem)
{
var Title = oListItem["Title"] != null ? oListItem["Title"].ToString() : "";
var EventDate = oListItem["EventDate"] != null ? oListItem["EventDate"].ToString() : "";
var EndDate = oListItem["EndDate"] != null ? oListItem["EndDate"].ToString() : "";
var Location = oListItem["Location"] != null ? oListItem["Location"].ToString() : "";
var Description = oListItem["Description"] != null ? oListItem["Description"].ToString() : "";
var guid = oListItem["GUID"] != null ? ListItem["GUID"].ToString() : "";
var created = oListItem["Created"];
var modified = oListItem["Modified"];
bool Event = Convert.ToBoolean(oListItem["fAllDayEvent"]);
var recurrenceData = oListItem["RecurrenceData"];
var Number = (int)oListItem["ows_owshiddenversion"];
}
but when I reached to the
var Number = (int)oListItem["ows_owshiddenversion"];** it gives me a Exception as
"+ Hidden 'oListItem.ParentList.Hidden' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException' bool {Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException}
"
which I am unable to resolve.