Certification Add Reference (DataRow[] to DataTable)

Hi All,

I’m exploring ways on converting DataRow to DataTable. Found a solution, CopyToDataTable but need to add reference as here. I would like to know if this is considered as external reference during the practical exam.

If yes, I would like to know what is the easiest option available. I found two here (might help others):

  1. New DataTable, initialize new fooDT > Assign fooDT = oldFooDT.Clone >
    For Each > Add Data Row > where ArrayRow = foo.ItemArray
  2. New DataTable > Build Data Table > For Each > Add Data Row > where ArrayRow = foo.ItemArray .

Either way, I’m not sure which one is much better and accepted during the practical exam. Saw many of this subject discussed here. Appreciate your insight.

Hello @khairulnashran

Welxome to the community!!!

It’s a good question. So the link you shared on adding assembly reference is not an external reference. If you have a programming background, this is similar to using the below code in C# or vb.net

Using system.Data;

If you do not have a programming background, we use such things to invoke the commands we need to perform several activities. For example if we use the command I mentioned above, it will allow you to use all the functions under system.Data . What happened in the assembly reference is the same. We use those so that we could use the functionality of each… So it is okay to use them.

Coming back to the main question, i would suggest using .CopyToDataTable would be the fastest approach to consider to convert a data row array to a datatable. Why I say that is, all the other approaches you listed in the question require a separate loop to run to add the data to the datatable which consume more time and resources. But, CopyToDataTable is a single line command which directly converts the array to a datatable with much more efficiency…

Hope it helps…

Merry Christmas and happy holidays

2 Likes

Hi Lahiru,

Thanks for your reply. Yes I have a bit of programming background and understood that using the assembly reference is only a means of using the underlying .Net frameworks.

I think I got an idea of what UiPath meant by external references, just to confirm that it is not against the rule for the certification.

Thank you again.

1 Like

No worries. Mostly external references are referred to orchestrator assets or queues or any other sources apart from those which are allowed. We cannot use orchestrator resources unless it is specified in the exam… :slightly_smiling_face:

Good Luck on your certification :slight_smile:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.