C
cmdolcet69
I have the below code that calls a function to delete a file that i
added to a listview node. What happens is that that file doesn;t
delete. Please help me out. I have included the event handler and
function. Thanks
Private Sub btnDeleteReport_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles btnDeleteReport.Click
_partfile.Reports.RemoveReport(Me.tvAddedReports.Nodes(0).Nodes(0).Text,
Me.tvAddedReports.Nodes(0).Nodes(0).Nodes(0).Text)
End Sub
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
Public Function RemoveReport(ByVal rPath As String, ByVal rPrinter As
String) As Integer
Try
Dim intloop As Integer
For intloop = 0 To reportArray.Count - 1
If CType(reportArray(intloop), Reports).ReportPath =
rPath And CType(reportArray(intloop), Reports).ReportPrinter =
rPrinter Then
reportArray.RemoveAt(intloop)
Exit For
End If
Next
Return 0
Catch ex As Exception
Return -1
End Try
End Function
added to a listview node. What happens is that that file doesn;t
delete. Please help me out. I have included the event handler and
function. Thanks
Private Sub btnDeleteReport_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles btnDeleteReport.Click
_partfile.Reports.RemoveReport(Me.tvAddedReports.Nodes(0).Nodes(0).Text,
Me.tvAddedReports.Nodes(0).Nodes(0).Nodes(0).Text)
End Sub
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
Public Function RemoveReport(ByVal rPath As String, ByVal rPrinter As
String) As Integer
Try
Dim intloop As Integer
For intloop = 0 To reportArray.Count - 1
If CType(reportArray(intloop), Reports).ReportPath =
rPath And CType(reportArray(intloop), Reports).ReportPrinter =
rPrinter Then
reportArray.RemoveAt(intloop)
Exit For
End If
Next
Return 0
Catch ex As Exception
Return -1
End Try
End Function