There is a folder that will have file to be loaded to a table.
This filename is dynamic in nature.
So, I am using a script task to get the filename .I am passing the folder path to this and also assigning a readwrite variable to hold the filename from the folder path .
But, it is giving an error message.
Here is the code :
ReadOnlyVarible in the script task :Inputfilename
ReadWriteVariables :filename
Imports System.Data
Imports Microsoft.SqlServer.Dts.Runtime
Imports System.Windows.Forms
Imports System.IO
Partial Public Class ScriptMain
Public Sub Main()
Dim Filename1 As String
Dim FilePath As String = Dts.Variables("User::inputFilePath").Value.ToString()
Dim list As String() = System.IO.Directory.GetFiles(FilePath, "*.xls*")
Dts.Variables("User::filename").Value = list
Dts.TaskResult = Dts.Results.Success
End Sub
End Class