Package Configuration in EzAPI

Feb 23, 2012 at 2:24 PM


I want to create a package configuration of type SQL Server which sets a ConnectionString of my Connection Manager.

Is this possible using the EzAPI?

Kind Regards /Per Hederos

Feb 27, 2012 at 2:37 PM


Figured it out. I don't know if it is the best way to do it though.


EzMyPackage<EzDerivedColumn> package = new EzMyPackage<EzDerivedColumn>("localhost", "Database", "SELECT * FROM TABLE", "FileName");

var p = (Microsoft.SqlServer.Dts.Runtime.Package)package.Package;
p.EnableConfigurations = true;
var c = p.Configurations.Add();
c.ConfigurationType = DTSConfigurationType.SqlServer;
c.Name = "NAME";
c.PackagePath = "\\Package.Connections[NameOfConnectionManager].Properties[ConnectionString]";
c.ConfigurationString = "\"DatabaseConfigurationManager\";\"TableName\";\"ConfigurationName\";";