Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Am trying to add items to share point list using C # code.
But am getting error
" Column 'xxx' does not exist. It may have been deleted by another user. /Lists/Test "
I dont know why am getting this error, all the fields whci am trying to call from program is available in List. but still am getting error.

Below is the code
C#
ClientContext clientContext = new ClientContext(SiteURL);
               SP.List oList = clientContext.Web.Lists.GetByTitle(ListName);
               ListItemCreationInformation itemCreateInfo = new ListItemCreationInformation();
               ListItem oListItem = oList.AddItem(itemCreateInfo);
oListItem["xxx"] = ExcelData.Tables[0].Rows[i]["xxxx"].ToString();
               oListItem.Update();
               clientContext.Credentials = new System.Net.NetworkCredential(UserName, PassWord, Domain);
                  clientContext.ExecuteQuery()



internal name of my field contains %%
Any solutions?
Please help
Posted
Updated 28-Dec-17 3:41am
v5
Comments
Am Gayathri 15-Nov-13 9:01am    
Any solutions?
oListItem["xxx"] = ExcelData.Tables[0].Rows[i]["xxxx"].ToString();

Left side it is having three x and in right side four. So, is it correct?
Am Gayathri 18-Nov-13 4:53am    
Here am not checking the equality of values, am assigning.
Any way thanks a lot for the replay.

Pass the internal name and replace %5F with _
 
Share this answer
 
you should use internal name.(below is the image to find internal name of column)
go to list setting -> Click on column name [Column (click to edit)] -> then you will see below image
 
Share this answer
 
Comments
CHill60 28-Dec-17 12:10pm    
No different to the accepted solution posted over 4 years ago

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