Assign: exception has been thrown by the target invocation

Hi all,

I am trying to go through a for each loop in a datatable (temp).
When I assign a value (no matter which one) to a column I get the error “Assign: exception has been thrown by the target invocation”.

Basically I just would need to add a data row to another datatable…
Any ways to overcome this?

Thanks a lot!

Resolution:
If I check dfma4.Columns.Count.ToString then it appeared it was empty. I built the datatable with the right columns and this worked…