I am working on a package in SSIS that needs to check a directory to see if any files that begin with a three character string (PDE) exist, and set the value of a variable accordingly to determine which path the package should follow next.
Here is the code I am using. I found it on a similar thread in this forum. The code runs without error but does not update the variable to 1 when a file exists. Any suggestions?
[CODE=vbnet]
Dim AllFiles() As String = System.IO.Direc tory.GetFiles(" \\fcfpsvr1\shar e\medicare\bipi mport\incomingf iles\", "*.txt")
Dim I As Integer
For I = 0 To AllFiles.Length - 1
If AllFiles(I).Sta rtsWith("PDE") Then
System.Diagnost ics.Debug.Write Line(AllFiles(I ))
Dts.Variables(" SourceFileExist s").Value = 1
End If
Next[/CODE]
Here is the code I am using. I found it on a similar thread in this forum. The code runs without error but does not update the variable to 1 when a file exists. Any suggestions?
[CODE=vbnet]
Dim AllFiles() As String = System.IO.Direc tory.GetFiles(" \\fcfpsvr1\shar e\medicare\bipi mport\incomingf iles\", "*.txt")
Dim I As Integer
For I = 0 To AllFiles.Length - 1
If AllFiles(I).Sta rtsWith("PDE") Then
System.Diagnost ics.Debug.Write Line(AllFiles(I ))
Dts.Variables(" SourceFileExist s").Value = 1
End If
Next[/CODE]
Comment