I have a DataFlow where there is a Script Component as a Source.
I have defined the Output (OutputRows) and Column (MyOutputValue) according to my needs.
When I want to test my script, even with hard coded values, I always get the same error:
System.NullReferenceException: Object reference not set to an instance of an object. at ScriptMain.CreateNewOutputRows().
I have no clue what's going wrong here. Any idea?
Here my code:
using System;
using System.Data;
using System.Windows.Forms;
using System.Threading;
using System.Globalization;
using Microsoft.SqlServer.Dts.Pipeline.Wrapper;
using Microsoft.SqlServer.Dts.Runtime.Wrapper;
using Microsoft.SqlServer.Dts.Runtime;
using Excel = Microsoft.Office.Interop.Excel;
[Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute]
public class ScriptMain : UserComponent
{
#region Members
String MyOutputValue;
#endregion
public override void PreExecute()
{
base.PreExecute();
MyOutputValue = "test";
CreateNewOutputRows();
}
public override void PostExecute()
{
base.PostExecute();
}
public override void CreateNewOutputRows()
{
OutputRowsBuffer.AddRow();
OutputRowsBuffer.MyOutputValue = MyOutputValue;
}
}
Within my SSIS Package I start debug and then I get the following screen (it is german, so I translated the error into english for this post):