How can I connect a SQL task to a data flow task programatically?
SQL Task:
Executable exec = package.Executables.Add("STOCK:SQLTask");
TaskHost thMainPipe = (TaskHost)exec;
...
Data flow:
MainPipe mp = ((TaskHost)stagingPackage.Executables.Add("DTS.Pipeline")).InnerObject as MainPipe;
...
Tried using PrecedenceConstraints.Add, get COM error.
PrecedenceConstraints.Add(derivedTask,(Executable) mp);
Unable to cast COM object of type 'System.__ComObject' to class type 'Microsoft.SqlServer.Dts.Runtime.Executable'.