UiPath Advanced RPA Developer (UiARD) — Question 54
A developer needs to reference the data in the first row of the "ID" column in the System.Data.DataTable, "DT". Which expression is used to reference this data?
Answer options
- A. DT.Rows(0).ID
- B. DT.Rows(0).Item("ID")
- C. DT.Rows(1).ID
- D. DT.Rows(1).Item("ID")
Correct answer: B
Explanation
The correct answer is B, as it accurately references the first row (index 0) and retrieves the value from the 'ID' column using the Item method. Option A does not work because direct property access is not valid for DataTable columns. Options C and D incorrectly reference the second row (index 1), which does not relate to the requirement of accessing the first row.