I am new to C Sharp programming. I am getting the error.
Script Component has encountered an exception in user code: Object reference not set to an instance of an object. at ScriptMain.Input0_ProcessInputRow(Input0Buffer Row) at UserComponent.Input0_ProcessInput(Input0Buffer Buffer) at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.ProcessInput(Int32 inputID, PipelineBuffer buffer)
This is my code as follows
using System;
using System.Data;
using Microsoft.SqlServer.Dts.Pipeline.Wrapper;
using Microsoft.SqlServer.Dts.Runtime.Wrapper;
using Microsoft.SqlServer.Dts.Runtime;
[Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute]
public class ScriptMain : UserComponent
{
public override void Input0_ProcessInputRow(Input0Buffer Row)
{
int iEx = 0;
int iPr = 0;
int iPa = 0;
int iSch = 0;
int iTim=0;
int iTime = 0;
int tryCount=1;
SC_819162ba1fcf40f686f8181327002472.csproj.WebReference.Service s = new SC_819162ba1fcf40f686f8181327002472.csproj.WebReference.Service();
SC_819162ba1fcf40f686f8181327002472.csproj.WebReference.LicenseUsage[] l = SC_819162ba1fcf40f686f8181327002472.csproj.WebReference.LicenseUsage[10];
l =null;
while (tryCount<=3)
{
try
{ l = s.GetProductPeakUsage(Row.salesforceidstring, Row.StartDatestring, Row.EndDatestring);
break;
}
catch (Exception e)
{
tryCount = tryCount + 1;
if (tryCount > 3)
{
bool pbCancel = false;
this.ComponentMetaData.FireError(9999, "Error-Failed the 3rd time", e.ToString(), "", 0, out pbCancel);
}
}
}
for (int i = 0; i < l.Length; i++)
{
if (l[i].Product == SC_819162ba1fcf40f686f8181327002472.csproj.WebReference.Product.Pr)
iPr = l[i].ActiveSeats;
if (l[i].Product == SC_819162ba1fcf40f686f8181327002472.csproj.WebReference.Product.Sch)
iSch = l[i].ActiveSeats;
if (l[i].Product == SC_819162ba1fcf40f686f8181327002472.csproj.WebReference.Product.Pa)
iPa = l[i].ActiveSeats;
if (l[i].Product == SC_819162ba1fcf40f686f8181327002472.csproj.WebReference.Product.Ex)
iEx = l[i].ActiveSeats;
if (l[i].Product == SC_819162ba1fcf40f686f8181327002472.csproj.WebReference.Product.Time)
iTime = l[i].ActiveSeats;
if (l[i].Product == SC_819162ba1fcf40f686f8181327002472.csproj.WebReference.Product.Tim)
iTim = l[i].ActiveSeats;
}
Row.Ex = iEx;
Row.Pr = iPr;
Row.Sch = iSch;
Row.Pa = iPa;
Row.Time = iTime;
Row.Tim=iTim;
}
}
Can somebody help how should I debug this? I understand I am getting null values for inputs. How to bypass null values in this logic