Welcome to MSDN Blogs Sign in | Join | Help

API Sample - Create a package with a data flow task

This code creates a package with a single data flow task. It will be used as a base for the more complicated code samples.

static void Main(string[] args)
{
    Package package = new Package();

    // Add Data Flow Task
    Executable dataFlowTask = package.Executables.Add("STOCK:PipelineTask");

    // Set the name (otherwise it will be a random GUID value)
    TaskHost taskHost = dataFlowTask as TaskHost;
    taskHost.Name = "Data Flow Task";

    // We need a reference to the InnerObject to add items to the data flow
    MainPipe pipeline = taskHost.InnerObject as MainPipe;
}
Published Tuesday, December 30, 2008 1:01 PM by mmasson
Filed under: ,

Comments

# Samples for creating SSIS packages programmatically

This is an index post for the series of posts with examples on how to create packages programmatically.

Tuesday, December 30, 2008 4:02 PM by SSIS Team Blog

# SSIS API使用示例 - 使用API构建SSIS包 (1)

1. 构建一个包含数据流任务(Data Flow Task)的包 下面的代码可以生成一个包含数据流任务的包,这个包不执行任何实际的工作,但是可以作为构建一个更复杂的包的基础: static void Main(

Tuesday, March 03, 2009 8:28 AM by SSIS 技术博客

# re: API Sample - Create a package with a data flow task

Hello Matt,

The samples you give are very good, but I really wish we had either a list of prerequisites, or a link to actually setting up the project to get to the point where this is helpful to us. For example, if I create a project, and just replace the main with your code sample, I get errors when I try to compile telling me that the Type or Namespace 'Package' cannot be found.

Could you help us get to the point where your samples work? Thank you for your work!

Friday, June 05, 2009 10:44 AM by stevenhoward
Anonymous comments are disabled
 
Page view tracker