Updating
batch.InnerXml = "<Method ID='1' Cmd='Update'>" +
"<Field Name='ID'>New</Field>" +
"<Field Name='Title'>Something</Field>" +
"<Field Name='SomeField'>Something Else</Field></Method>";
"<Field Name='ID'>New</Field>" +
"<Field Name='Title'>Something</Field>" +
"<Field Name='SomeField'>Something Else</Field></Method>";
There is only one difference comparing to previous post, the value of the attribute "Cmd". The value is "New" in previous post. Now you only need change it to "Update". You should pay attention to the ID field, you need specify this field.
Deleting
batch.InnerXml = "<Method ID='1' Cmd='Delete'>" +
"<Field Name='ID'>New</Field>" + </Method>";
Deleting is very simple. You only need change the Cmd value to "Delete", and provide the ID of item you want to delete.
After you call the service operation, it would return a XML snippet containing the information if the operation is successful or not.
No comments:
Post a Comment