2010-06-22 184 views
1

有誰有如何提高UpdateListItems功能(在Lists.asmx)性能的任何recomendations插入列表項時我怎樣才能提高性能使用SharePoint Web服務

林的發現,它需要大約1-2插入新項目的秒數是否正常?

繼承人,其即時通訊的循環,它運行內運行的代碼IM約1000倍

Dim xmlDoc As New System.Xml.XmlDocument() 
Dim query As System.Xml.XmlElement = xmlDoc.CreateElement("Batch") 

query.SetAttribute("OnError", "Return") 
query.SetAttribute("ListVersion", "1") 

query.InnerXml = "<Method ID='1' Cmd='New'>" & _ 
       "<Field Name='FieldName'>" & FieldData & "</Field>" & _ 
       "</Method>" 

Dim Result As XmlElement = L.UpdateListItems("List Name", query) 

提前感謝!

回答

1

您可以在一次調用Web服務的過程中進行多次更新 - 即調用環路的以外的更新

所以你可以發送到UpdateListItems這樣會更新2批記錄。

<Batch OnError="Continue" ListVersion="1" 
ViewName="270C0508-A54F-4387-8AD0-49686D685EB2"> 
    <Method ID="1" Cmd="Update"> 
     <Field Name="ID">4<Field> 
     <Field Name="Field_Name">Value</Field> 
    </Method> 
    <Method ID="2" Cmd="Update"> 
     <Field Name="ID" >6</Field> 
     <Field Name="Field_Name">Value</Field> 
    </Method> 
</Batch> 
+0

不錯的一個!...我正在努力尋求其他解決方案,事實上,我應該剛剛閱讀文檔!謝謝 – 2010-06-23 20:48:41