SSIS properties question


 

hi programmatically creating ssis package.so set different connection properties using c# coding.

 

there 2 properties need set establish connection.those connection manager properties , connection moniker properties.

 

my questions are

 

1)both of these have connection string properties.do have 2 set both of these separately or setting 1 connection string enough?

 

2) in excel manager connection there server name,user name,password,initial catalog properties can ignore these , set connection string properties directly?

 

can 1 give me info abt this.

 

thanks

lucki

hi, need set properties of connection manager. , can set connection string property directly.

 here complete sample on adding connection managers. sample sql server 2008 sample package, can publicly downloaded microsoft website:

 private void addconnectionmanagers(string destinationdatadirectory)
 {
            // add oledb connection manager.
            connectionmanager adventureworks = this.package.connections.add("oledb");

            // set stock properties.
            adventureworks.name = "oledbconnection";
            adventureworks.connectionstring = @"provider=sqlncli10;integrated security=sspi;persist security info=false;initial catalog=adventureworks;data source=(local);auto translate=false;";

            // add destination connection manager.
            connectionmanager cmflatfile = this.package.connections.add("flatfile");

            // set stock properties.
            cmflatfile.properties["connectionstring"].setvalue(cmflatfile, destinationdatadirectory + datafilename);
            cmflatfile.properties["format"].setvalue(cmflatfile, "delimited");
            cmflatfile.properties["datarowstoskip"].setvalue(cmflatfile, 0);
            cmflatfile.properties["columnnamesinfirstdatarow"].setvalue(cmflatfile, false);
            cmflatfile.properties["name"].setvalue(cmflatfile, "flatfileconnection");
            cmflatfile.properties["rowdelimiter"].setvalue(cmflatfile, "\r\n");
            cmflatfile.properties["textqualifier"].setvalue(cmflatfile, "\"");
        }

 



SQL Server  >  SQL Server Integration Services



Comments

Popular posts from this blog

Conditional formatting a graph vertical axis in SSRS 2012 charts

Register with Power BI failed

SQL server replication error Cannot find the dbo or user defined function........