Hi,
can anyone tell me how to delete a from from sharepoint library?
I have searched through the site and I found post from Agni Reddy (
http://www.infopathdev.com/blogs/agni/archive/2006/03/12/Delete-File-from-SharePoint.aspx
), but I was not able to get it to work.
On Agni's post, I wasn't able to get the following part to work. Can anyone have an easier way to delete a form or does anyone know how to get this to work?
Add code to call the SharePointDelete data connection:
- Open the following code into the FormCode.cs:
private void deleteFile(string fileName) { thisXDocument.GetDOM("UpdateListItemsConfig").selectSingleNode("/UpdateListItemsConfig/SharepointDelete/Batch/Method/Field[@Name = 'FileRef']").text = fileName; WebServiceAdapter2 deleteFileFromSharepoint = (WebServiceAdapter2)thisXDocument.DataAdapters["SharePointDelete"]; deleteFileFromSharepoint.Submit(); } |
- Pass the complete filepath to the Method for deleting the File
Ex: http://serverName/sites/SharePointDelete/TestDelete.xml
Any help would be appreciated.
Thanks