1 回答

TA貢獻1775條經驗 獲得超8個贊
您的代碼邏輯應該沒問題,請確保查找列表中存在 anInteger 項。
我測試過的代碼。
using(var clientContext =new ClientContext("http://sp"))
{
var web = clientContext .Web;
var oList = web.Lists.GetByTitle("TestDetails");
ListItemCreationInformation itemCreateInfo = new ListItemCreationInformation();
ListItem oListItem = oList.AddItem(itemCreateInfo);
FieldLookupValue lookupField = new FieldLookupValue();
lookupField.LookupId = 1;
oListItem["Title"] = "My New Item!";
oListItem["Name"] = lookupField;
oListItem.Update();
clientContext.ExecuteQuery();
Console.WriteLine("complete");
}
- 1 回答
- 0 關注
- 149 瀏覽
添加回答
舉報