Sharepoint 2010 VB.net添加到列表中

Sharepoint 2010 VB.net添加到列表中,vb.net,sharepoint,sharepoint-2010,sharepoint-designer,Vb.net,Sharepoint,Sharepoint 2010,Sharepoint Designer,嘿,我只是想在我的sharepoint网站的列表中添加一些数据 以下代码是我尝试使用的代码: Dim siteUrl As String = "http://thespsite/sandbox/" Dim clientContext As New ClientContext(siteUrl) Dim oList As List = clientContext.Web.Lists.GetByTitle("demoT") Dim listCreationInformation As New List

嘿,我只是想在我的sharepoint网站的列表中添加一些数据

以下代码是我尝试使用的代码:

Dim siteUrl As String = "http://thespsite/sandbox/"
Dim clientContext As New ClientContext(siteUrl)
Dim oList As List = clientContext.Web.Lists.GetByTitle("demoT")
Dim listCreationInformation As New ListItemCreationInformation()
Dim oListItem As ListItem = oList.AddItem(listCreationInformation)

oListItem("Title") = "testing this out"
oListItem("Priority") = "(2) Normal"
oListItem("AssignedTo") = "Lastname, Firstname"
oListItem.Update()
clientContext.ExecuteQuery()
我的列表称为降级,而标题、优先级和分配给的字段都是我希望添加到列表中的字段。当然,Lastname、Firstname是用SPDB中的实际名称填写的

但是,这是我得到的错误:

An exception of type 'Microsoft.SharePoint.Client.ServerException' 
occurred in Microsoft.SharePoint.Client.Runtime.dll but was not 
handled in user code

Additional information: Invalid data has been used to update the 
list item. The field you are trying to update may be read only.
我知道评论是存在的,因为我在我的列表上看到它。。。只是不知道为什么它不允许我添加?如果我对代码的这一部分进行注释并运行它,它会很好地发布到列表中

分配给零件的Sharepoint Designer HTML代码为:

<SharePoint:FormField runat="server" id="ff2{$Pos}" ControlMode="New" 
    FieldName="AssignedTo" __designer:bind="{ddwrt:DataBind('i',concat('ff2',$Pos),
       'Value','ValueChanged','ID', ddwrt:EscapeDelims(string(@ID)),'@AssignedTo')}"/>
<SharePoint:FieldDescription runat="server" id="ff2description{$Pos}" 
    FieldName="AssignedTo" ControlMode="New"/>


我可能会遗漏什么来阻止它添加该字段?

我的第一个猜测是“分配给”字段的格式错误。请参见此处开始: