user264791
user264791

Reputation:

SSIS script task error retrieving variable values

In a Script Task, I am trying to retrieve a file from a networked location and FTP that file to an offsite location

So I have commented out and found the error is generating on retrieving the variable value but I do not know what is incorrect here

    Dim remotePath As String = Dts.Variables("FTPFilePath").Value.ToString

I have tried multiple variable retrievals and all get the same error. Anyone see anything wrong?

Upvotes: 6

Views: 17318

Answers (1)

Keith Adler
Keith Adler

Reputation: 21178

Two things:

  1. Make sure you config the Script Task to have Read Access to the variable. To do this right-click on the Script Task and select Edit. Click the ... under ReadOnlyVariables.
  2. Fully qualify your variables such as Dts.Variables["User::RemotePath"].Value

Upvotes: 16

Related Questions