How To Read From SSIS Package Configurations In Script Task Codebehind

Hello,
I have an SSIS package that used to read connection string information from environment variables on the computer the package is running on, however we have started using package configurations and I wanted to know if there is a way to read SSIS Package configurations from the code behind in an SSIS Script Task.
endrecAsked:
Who is Participating?
 
mrichmonConnect With a Mentor Commented:
Not sure if you can access directly, but what we did was have the SISS Package Configuration assign values to package level variables and then we were able to access/manipulate those variables from within the script task.
0
 
Megan BrooksSQL Server ConsultantCommented:
You want to read ConnectionString properties from an SSIS configuration file, as opposed to reading actual ConectionString values from connection managers in the executing package? And you don't want to apply the configuration data to the package before it starts?
The configuration files are XML, and if your package has read access to them it can use the .Net Framework XML classes to fetch whatever  information it needs from the files.
0
 
Reza RadConnect With a Mentor Commented:
you can use xmlreader classes in .net for reading configuration , because this is xml file,
but why you want to do this? if you have a connection manager in your package which use this connection string stored in package configuration, you can simply use this connection manager inside script tasks. ssis has builtin features for this.
0
All Courses

From novice to tech pro — start learning today.