Why need the script task to show up all of the three files for the ForEach container?



The piece of VB.NET code in the Script Task is as follows:

Public Sub Main()
'
        Dts.Connections("Excel Connection Manager").ConnectionString() = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Dts.Variables("FileName").Value.ToString() + ";Extended Properties=""EXCEL 8.0;HDR=YES"";"
'
Dts.TaskResult = ScriptResults.Success
End Sub

If the Script Task is disabled, the 1st Excel file will be processed three times (There are three files in the folder).

With the Script Task, the three Excel files are processed as desired.



The is the Data Flow Part: