I am downloading a json file and successfully putting it in a table using data flow and script component object.
Within my json file there is a count of numbers row I should import and how many pages it would take to import the data.
e.g. "count": 1925, "current page": 1, "total pages": 2, "results":
I on my url to get the json file, I have to specify which page I'm trying to get. e.g. &page=" + PageNo
I would like to automate my SSIS package to do this. I have managed to assign the user variables to get the count rows imported, count of row to be imported by using the readwrite function in the script component by assign the in the Post Execute area.
I would like to use the For Loop container to Loop the data flow and keep importing the data until the count rows imported are equal to be count of row to be imported.
My problems is when I execute the Control Flow, I keep getting the error
The collection of variables locked for read and write access is not available outside of PostExecute.
How do I get the variables to change so I can use them the for Loop container?
Added code as per Brad's request.
public override void PostExecute()
{
base.PostExecute();
Variables.RowsImported = i;
Variables.RowsTobeImported = totalcount;
if (totalcount > i)
Variables.PageNoExtra = Variables.PageNoExtra + 1;
MessageBox.Show(Variables.RowsImported.ToString());
MessageBox.Show(Variables.RowsTobeImported.ToString());
//MessageBox.Show(Variables.PageNoExtra.ToString());
}