2011-11-30 83 views
0

我正嘗試使用SharePoint列表Web服務更新列表。但我收到以下錯誤UpdateListItems在嘗試更新SharePoint中的列表時發生錯誤

Results xmlns="http://schemas.microsoft.com/sharepoint/soap/"> 
<Result ID="1,Update"> 
    <ErrorCode>0x8102000a</ErrorCode> 
    <ErrorText>Invalid URL Parameter. The URL provided contains an invalid Command or Value. Please check the URL again.</ErrorText> 
    </Result> 
    </Results> 

這裏是我的代碼片斷

string strViewID = "{46FCE9EB-C789-430F-B1A3-9ACA41FE9BD9}"; 
      XmlDocument camlDocument = new XmlDocument(); 
      XmlNode queryNode = camlDocument.CreateElement("Query"); 
      XmlDocument myListDoc = new XmlDocument(); 
      XmlElement batchXML = myListDoc.CreateElement("Batch"); 
      batchXML.SetAttribute("OnError", "Continue"); 
      batchXML.SetAttribute("ListVersion", "1"); 
      batchXML.SetAttribute("ViewName", strViewID); 

      batchXML.InnerXml = "<Method ID ='1' Cmd='Update'>" + "<Field Name='Title'>Z</Field>" +"<Field Name='Region'>West</Field>"+ 
       "<Field Name='Size'>Z</Field>" + "<Field Name='Sales'>Z</Field></Method>";  
       XElement sys = XmlElementToXelement(batchXML); 
       XElement myListReturn = ws.UpdateListItems("{A30AFD47-7118-4904-A3B9-BCEFF7E3E203}", sys); 

請幫助。

回答

5

你可能想嘗試在更新你的其它列一起加入ID列,然後再試一次 -

<字段名稱=「ID」>字段的ID,你打算更新

+0

很抱歉的空間在<字段名稱='ID'>您打算更新的字段的ID –

+0

感謝它的工作.. – SSG

相關問題