I'm trying to delete but the code seems that can't find the Item field :
try
{
using (ClientContext context = new ClientContext("http://to0wss2k10rey03/sites/ReplyCorp"))
{
if (WindowsIdentity.GetCurrent().IsAuthenticated)
{
var currentCredential = System.Net.CredentialCache.DefaultCredentials;
context.Credentials = currentCredential;
try
{
SP.List oList = context.Web.Lists.GetByTitle("ContentIndex");
CamlQuery camlQuery = new CamlQuery();
camlQuery.ViewXml = @"<View>
<Query>
<Where>
<Eq>
<FieldRef Name='tt_contentid'/>
<Value Type='Text'>ContentIndex_test</Value>
</Eq>
</Where>
</Query>
</View>";
ListItemCollection collListItem = oList.GetItems(camlQuery);
context.Load(collListItem);
context.ExecuteQuery();
int id = COUNT;
foreach (ListItem oListItem in collListItem)
{
if (oListItem["tt_contentid"].Equals(id))
{
oListItem.DeleteObject();
}
}
oList.Update();
}
catch
{
throw new ArgumentException("Can't find Item with this ID " /*+ updateContentObj.contentId, "tt_contentid"*/);
}
The code always go to the exception: "can't find Item whit ID" and give me the following error message:
One or more field types are not installed properly. Go to the list settings page to delete these fields.