How To Read From SSIS Package Configurations In Script Task Codebehind

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.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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.
Reza RadConsultant, TrainerCommented:
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.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.