Click here to Skip to main content
15,885,244 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:
C#
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
Posted
Updated 28-Apr-14 11:40am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900