I created the variable outside, public so when I create the Task Script in the field ReadWriteVariables I can see it and I pick it up.
Then in the Tab Script inside the Task Script I wrote the sentence you gave me
Public Sub Main()
varConnectionString as string
varConnectionString = Dts.Connections.Item("SQL_NCDW_Configuration").ConnectionString
But I received this error: Error at Script Task: The binary code for the script is not found. Please open the script in the designer by clicking Edit Script button and make sure it builds successfully.
Error at Script Task: There were errors during task validation.