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

1 Answer 1

3

Update this

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.