While dealing with data table operations, sometimes we might want to retrieve only specific columns from it.
How to do that?
Simply replace the “Column1″,”Column2” and so on with your required Columns
Implementation using UiPath :
Let us implement a workflow which takes a “DataTable” and gives us out the “DataTable with specific columns“.
Drag “Build Data Table” activity into the design panel and populate it with some sample data.
Drag “Assign” activity into the design panel and fill it with above-mentioned code.
Drag “Message Box” activity to display the result
(Note: Here we have used LINQ to display the DataTable Instead of Output DataTable
string.join(System.Environment.NewLine, dt_YourDataTable.Rows.Cast(of DataRow).Select(function(row) string.join(“,”,row.ItemArray))))
Click here to download the Source Code…
Hope it has helped you…