How to update Properties of Uploaded Documents on Sharepoint using Web Services ? : c#

Posted by Preeti on Stack Overflow See other posts from Stack Overflow or by Preeti
Published on 2010-03-05T10:12:43Z Indexed on 2010/03/08 5:06 UTC
Read the original article Hit count: 711

Filed under:
|

Hi,

I am trying to Update/Edit Properties of Uploaded Document on Sharepoint 2007.

My code:

 Lists listService = new Lists();
 listService.PreAuthenticate = true;
 listService.Credentials = new NetworkCredential(username,password);
 listService.Url = "http://myserver/SiteName/_vti_bin/lists.asmx";

 string strBatch =

                   "<Method ID='1' Cmd='Update'> "
                   + " <Field Name='ID'>3</Field> "
                   + " <Field Name='Name'>Preeti</Field> "                 
                   + " </Method> ";

 XmlDocument xmlDoc = new System.Xml.XmlDocument();
 System.Xml.XmlElement elBatch = xmlDoc.CreateElement("Batch");
 elBatch.SetAttribute("OnError", "Continue");

elBatch.SetAttributeNode("UserName", "Preeti");
elBatch.InnerXml = strBatch;
XmlNode ndReturn = listService.UpdateListItems(ListName, elBatch);

MessageBox.Show(ndReturn.OuterXml); 

Refering Link.

Getting Error: "One or more field types are not installed properly. Go to the list settings page to delete these fields".

Regards,

Preeti

© Stack Overflow or respective owner

Related posts about c#

Related posts about sharepoint2007