Help: Invoke Code Exception has been thrown

Hi, I am trying to use the invoke code activity to write data to a new data table from an input csv file, however i keep running into this error.
if (inputTable != null && inputTable.Rows.Count > 0)
{
if (processedTable == null)
{
processedTable = new DataTable();
processedTable.Columns.Add(“Test Column”, typeof(string));
}
processedTable.Rows.Add(“Test Data”);
}
What am I doing wrong? I have declared processedTable in the Variables pane, but nothing seems to work.

Are you passing these as Arguments as well??

I believe you are doing this to understand the concept of invoke code as we have simple methods to achieve the same

@vageesh.dixit,

Can you show the properties of Invoke code activity and the arguments of it.

The code is in C# make sure you selected the same in property of Invoke code.

@vageesh.dixit

  1. I believe the arguments are not passed
  2. Why not use UiPath activities directly istead of invoke code?

cheers