1

I have used server object model to update list item based on title field and used below code

SPList list = web.Lists["ListName"];

SPListItemCollection items = list.GetItems(new SPQuery()
{
    Query = @"<Where>
                <Eq>
                   <FieldRef Name='Title' />
                   <Value Type='Text'>objdocument.title</Value>
                </Eq>
              </Where>"
});

foreach (SPListItem item in items)
{
    item["Properties"] = objdocument.empID + objdocument.proID 
    item.Update();
}

I have debug the code and debugger is not entering in foreach loop. Can anyone please help

3

Update this

<Value Type='Text'>" + objdocument.Title + "</Value>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.