How to update lookup fields in sharepoint list
Hi,I have a list that contains 3 lookup fields , i was trying to update the list item through custom webpart, but only one lookup field is getting updated rest fields are empty.
here the code iam using:
SPListItem itms = list.AddItem();
web.AllowUnsafeUpdates = true;
SPFieldLookupValue value1= new SPFieldLookupValue(Convert.ToInt32(row.Cells[0].Text) ,row.Cells[0].Text);
itms["ClientID"] = value1;
SPFieldLookupValue value2=new SPFieldLookupValue(Convert.ToInt32(row.Cells[1].Text), row.Cells[1].Text);
itms["ManagerID"] = value2;
SPFieldLookupValue value3 = new SPFieldLookupValue(Convert.ToInt32(row.Cells[2].Text), row.Cells[2].Text);
itms["RecruiterID"] = value3;
SPFieldLookupValue value4 = new SPFieldLookupValue(Convert.ToInt32(drps.SelectedValue.ToString()), drps.SelectedValue.ToString());
itms["RequirementID"] = value4;
itms.Update();
web.AllowUnsafeUpdates = false;
only the ClientID is getting updated
what could be the reason please help.
thanks
Ginnas
