SharePoint UpdateListItems does not actually update data

  • Thread starter Thread starter IM
  • Start date Start date
I

IM

I have the following code which does not update anything in SQL.
Other tasks, like getting list of sites and list of documents work just
fine, but update does not seem to trigger anything. I want to be able to
change the column Column1 for a document with the name testDocument.
No errors are returned. I do run it on the box where SharePoint is, so
credentials is not an issue as it works for other tasks. Thanks in advance.

Dim listService As New SPService.Lists()
listService.Credentials = System.Net.CredentialCache.DefaultCredentials

Dim listName As String = '576E6735-4660-450F-B12F-A11D9CB49F5E'

Dim xmlDoc As XmlDocument = New XmlDocument

Dim batchElement As XmlElement = xmlDoc.CreateElement("Batch")

batchElement.InnerXml = "<Method ID='1' Cmd='Update'><Field
Name='Name'>testFile</Field><Field Name='Column1'>Column1</Field></Method>"

listService.UpdateListItems(listName, batchElement)
 
Correction, I want to be able to update testFile, not testDocument, so query
is correct
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top