sql server - Setting PathAnnotation on SSIS path from code -
i have been trying lately create ssis packages .net code rather using drag , drop in visual studio. part of package documentation, able annotate data flow paths.
the code below - copied msdn - establishes path between 2 ssis data flow components. adding
path.name = "my name"; new application().savetosqlserver(package, null, "localhost", "myuser", "mypassword");
i can set name of path whatever , save package in local sql server. when open package in visual studio 2008, however, name of path can seen under path properties.
in visual studio, there path property, pathannotation, value asneeded , additional possibilities sourcename, pathname, never. changing value pathname gives me want: path name appears next path in data flow tab in visual studio.
my question is: possible set value of pathannotation property code?
using system; using microsoft.sqlserver.dts.runtime; using microsoft.sqlserver.dts.pipeline; using microsoft.sqlserver.dts.pipeline.wrapper; namespace microsoft.sqlserver.dts.samples { class program { static void main(string[] args) { package package = new package(); executable e = package.executables.add("stock:pipelinetask"); taskhost thmainpipe = e taskhost; mainpipe dataflowtask = thmainpipe.innerobject mainpipe; // create source component. idtscomponentmetadata100 source = dataflowtask.componentmetadatacollection.new(); source.componentclassid = "dtsadapter.oledbsource"; cmanagedcomponentwrapper srcdesigntime = source.instantiate(); srcdesigntime.providecomponentproperties(); // create destination component. idtscomponentmetadata100 destination = dataflowtask.componentmetadatacollection.new(); destination.componentclassid = "dtsadapter.oledbdestination"; cmanagedcomponentwrapper destdesigntime = destination.instantiate(); destdesigntime.providecomponentproperties(); // create path. idtspath100 path = dataflowtask.pathcollection.new(); path.attachpathandpropagatenotifications(source.outputcollection[0], destination.inputcollection[0]); } }
i succeeded in getting answer in different forum. please see
Comments
Post a Comment