Hi guys ,
i want to update a specific field in a List Item .. below is my code
SPSite site1 = new SPSite("http://spserver2010/sites/Testing/ProjectTest");
SPWeb web = site1.OpenWeb();
SPList list = web.Lists["Project Site Link"];
SPQuery query = new SPQuery();
query.Query ="<Query> <Where> <Eq> <FieldRef Name='Project_x0020_Name' /> <Value Type='String'>TextBox2.Text</Value></Eq> </Where></Query>";
SPListItemCollection collListItems = list.GetItems(query);
foreach (SPListItem item in collListItems)
{
item["Project_x0020_Description"] = "http://spserver2010/sites/Testing/ProjectTest" + TextBox2.Text;
item.Update();
}The problem is that the code update all the item in the Project_x0020_Description colum and not only the item where'Project_x0020_Name' is equal TextBox2.Text..
Any idea
Thanx!