Package Configuration in EzAPI

Feb 23, 2012 at 1:24 PM

Hi!

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 1:37 PM

Hi!

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

Example:

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\";";