Here are all the actual test exam dumps for IT exams. Most people prepare for the actual exams with our test dumps to pass their exams. So it's critical to choose and actual test pdf to succeed.

Exam UiPath-ADPv1 Topic 1 Question 201 Discussion

Actual exam question for UiPath's UiPath-ADPv1 exam
Question #: 201
Topic #: 1
The following table is stored in a variable called "dt".

Which query can be used to extract the table column names and store them in a list?

Suggested Answer: A Vote an answer

The DataTable object in UiPath is a representation of a table with rows and columns that can store data of various types. It has a Columns property that returns a collection of DataColumn objects that describe the schema of the table1. To extract the column names from a DataTable and store them in a list, you can use the following query:
dt.Columns.Cast(Of Datacolumn).Select(function(x) x.ColumnName).ToList() This query does the following:
* It casts the Columns collection to a generic IEnumerable(Of DataColumn) using the Cast(Of T) extension method2. This is necessary because the Columns collection is a non-generic IEnumerable that cannot be used with LINQ methods directly3.
* It selects the ColumnName property of each DataColumn object using the Select extension method and a lambda expression4. The ColumnName property returns the name of the column as a string5.
* It converts the resulting IEnumerable(Of String) to a List(Of String) using the ToList extension method6.
The other options are incorrect because:
* Option B does not cast the Columns collection to a generic IEnumerable(Of DataColumn), which will cause a runtime error.
* Option C uses the AsEnumerable extension method, which returns a collection of DataRow objects, not DataColumn objects7. Therefore, the ColumnName property will not be available.
* Option D selects the whole DataColumn object instead of its ColumnName property, which will result in a list of DataColumn objects, not strings.
References:
DataTable Class (System.Data) | Microsoft Docs
Enumerable.Cast(Of TResult) Method (System.Linq) | Microsoft Docs
DataColumnCollection Class (System.Data) | Microsoft Docs
Enumerable.Select(Of TSource, TResult) Method (System.Linq) | Microsoft Docs DataColumn.ColumnName Property (System.Data) | Microsoft Docs Enumerable.ToList(Of TSource) Method (System.Linq) | Microsoft Docs DataTableExtensions.AsEnumerable Method (System.Data) | Microsoft Docs

by Julie at Mar 11, 2026, 07:02 AM

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Nick name: Submit Cancel
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.