Cannot create table in Invoke Code Activity

Hi,

I want to create a data table inside invoke code activity but I am getting error

“Invoke code: Exception has been thrown by the target of an invocation.”

Here are my code and arguments inside invoke activity:
aa

Any help in this regard?

Best,
Waseem khan

Hi,

First, can you check details of exception from $exceptionDetails at LocalsPanel?

If it’s null reference exception, can you modify Out to In at Direction of dtOrig in ArgumentPanel?
(If dt_test is already created before then)

Or add the following at the first line.

Dim dtOrig As DataTable = New DataTable()

Regards,

Hi,

Try to make variable as In/Out and don’t forget to initialize data table as “New DataTable”

Thanks for your feedback. I can only see variables and arguments:

From where can I check exceptionDetails?

The error is gone if I write create datatable at the very start of code : Dim dtOrig As DataTable = New DataTable()
But there is another problem. I want to copy a filled datatable to this newly created datatable. The filled datatable is dt_tempSql and it has same column names. I do not know, how to specify arguments in this case? I want to insert dtOrig into sql server afterwards.
bb