Delete a file from sharepoint library using lists webservice

M

Moe.Vafaei

Hi,
I'm getting null reference exception trying to delete a file in sharepoint
library using a datasource and dataconnection inside IP 2007. I removed the
datasource and dataconnection and created them again and the XPath is also
correct, but still getting the error.

I’ve added two Try...Catch blocks to see where the error is happening and
found out it’s happening in second try.

Very appreciate your somments as I'm stuck in completing my project.
Moe

Dim nav As XPathNavigator
Try
nav = Me .DataSources( "UpdateListItemsConfig"
).CreateNavigator()
Catch ex As Exception
Me .CreateNavigator.SelectSingleNode( _
"/my:YRPDutyExceptionForm/my:field38" ,
NamespaceManager).SetValue( "1) " & ex.Message.ToString)
End Try

Try
nav.SelectSingleNode( _

"/UpdateListItemsConfig/SharepointDelete/Batch/Method/Field[@Name='FileRef']"
) _
.SetValue(filename)
Catch ex As Exception
Me .CreateNavigator.SelectSingleNode( _
"/my:YRPDutyExceptionForm/my:field38" ,
NamespaceManager).SetValue( "2) " & ex.Message.ToString)
End Try

DataConnections( "SharePointDelete" ).Execute()
 
M

Moe.Vafaei

Just wnated to correct the error message I'm receiving.
The error message is: "Object reference not set to an instance of an object"

Greatly ppreciate your thoughts.
Moe
 

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

Top