QuestionQ166

VerifiedUiPath Automation Development

A developer used the Add Data Row activity to add a row to a data table named "dt_Reports." However, at runtime, UiPath Studio throws the exception, "Add Data Row: Object reference not set to an instance of an object," because the data table has not been initialized.

To resolve this problem, what should the developer add in an Assign activity before the Add Data Row activity?

Explanation

dt_Reports must reference an instantiated System.Data.DataTable before Add Data Row can add a record. Assigning New System.Data.DataTable to dt_Reports initializes the required table object.

Community Discussion

No comments yet. Be the first to start the discussion!