Wednesday, March 28, 2012

Persist ConnectionString

Hello All,

I have changed connection string property of connectionmanger at runtime and saved package.But my new connectionstring is not persisting, i am getting my old connection string after reload package .

ConnectionManager cm = package.Connections[test.ConnectionManagerID];

cm.ConnectionString = @."C:\Test.csv";

app.SaveToDtsServer(package, null,

@."File System\Dupaco Load Next Best.dtsx", "CIRCLE");

How can I save new connection string?.

Please help me.

Thanks

Subin

The ProtectionLevel property of the ConnectionManager will change what and if sensitive information is saved.

Personally I do not like saving sensitive information in a package, I much prefer using configurations. This allows you to keep such information externally, and just by changing the configuartion information between environments you can easily manage this. This mechanism is obviously great for when moving packages between test and production environments for example, but it scales right down to the developer's desktop, so you use the same mechanism throughout.

No comments:

Post a Comment