1

In response to my deleted post

I am suspecting (I could be wrong) a way to transfer limited number of rows from 1 Dataflow Task to another is by using DataReader in the first one and ScriptTask as Source in the second one.

I need to know how to derive Connection String to connect to that DataReader if this is all done in one package.

I was looking for a way to send processed rows from one DataFlow Task to another to simplify my design and have better control.

Andriy M
  • 76,112
  • 17
  • 94
  • 154
N_E
  • 743
  • 10
  • 16
  • Your old link is dead. how about some details. – Zane May 06 '15 at 20:27
  • Ooo...I was in disbelief when i saw my post is marked as [deleted by community], I didn't know that i am the only one who can view it. My original question from previous posted is quoted in my re-edited question. – N_E May 06 '15 at 20:40

1 Answers1

0

Here is my remarkable solution to this problem!

RecordSet Source

Code For RecordSet Source with used example

using System;
using System.Data;
using Microsoft.SqlServer.Dts.Pipeline.Wrapper;
using Microsoft.SqlServer.Dts.Runtime.Wrapper;
using System.Data.SqlClient;
using System.Windows.Forms;
using System.Data.OleDb;
using System.Linq;
using System.Data.DataSetExtensions;

[Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute]
public class ScriptMain : UserComponent
{

    private OleDbDataAdapter oleDA = new OleDbDataAdapter();
    private DataTable table = new DataTable();
    private DataRow[] result;


    public override void PreExecute()
    {

        base.PreExecute();

        oleDA.Fill(table, Variables.DatabaseObjects);


        var query = from table_address in table.AsEnumerable()

                    select table_address;

        result = query.ToArray<DataRow>();


    }

    public override void PostExecute()
    {
        base.PostExecute();

    }

    public override void CreateNewOutputRows()
    {
        if (result != null)
        {
            foreach (DataRow ro in result)
            {
           Output0Buffer.AddRow();
//----------------------------------------[CHANGE BELOW]-------------------------------------------------
// EXAMPLE:       
       if (ro["File"] != null && ro["Sequence_ID"] != null && ro["Execution_ID"] != null && ro["Object"] != null)
                {
                    Output0Buffer.File = ro["File"].ToString();
                    Output0Buffer.SequenceID = Convert.ToInt64(ro["Sequence_ID"]);
                    Output0Buffer.Object = ro["Object"].ToString();
                    Output0Buffer.ExecutionID = Convert.ToInt64(ro["Execution_ID"]);
            }
//--------------------------------------- [CHANGE ABOVE]------------------------------------------------
            }
        }
    }






}
N_E
  • 743
  • 10
  • 16