I have a ListItem and would like to set the Name field for a file in a doc library. Researching this question I have seen that you can set an SPListItem name like this
SPListItem oListItem = oList.Items[0];
oListItem["Name"] = "xyz";
oListItem.Update();
I am assuming it's different because I am using ListItem and not SPListItem because when I tried to do that in my solution it says the field Name does not exist. What is the right way to do this with ListItem?
ListItem listItem = uploadFile.ListItemAllFields;
listItem["Name"] = "xyz";
listItem.Update();