Need help, as struggling to write code:
Below function will iterate through database to fetch file name and then download those files if exists. I’m struggling to write the code here “Download Files Code here”. Also need it to return ARRAY which should be name of files which have been download in this code.
Can anyone please help.
Public Function DownloadFile(ByVal SourcePath As String, ByVal TargetPath As String) As Boolean
Dim DownloadFile As Boolean = False
Dim lvar_FileName As String = Nothing
Dim lvar_FileType As String = Nothing
Using Conn As New SqlConnection(ConnString)
SQLCommand = New SqlCommand("File_List",Conn)
SQLCommand.CommandText = "Select File_Name from File_List "
Try
Conn Conn.Open()
Dim reader As SqlDataReader
reader = SQLCommand.ExecuteReader()
While reader.Read()
'Code Here
lvar_FileName = reader(0)
'Download Files Code here
End While
Catch ex As Exception
End Try
End Using
Return DownloadFile
End Function
Regards
Instead of an array i would return a
List(Of String)since it can be resized: