How to show each row from a data table without using any loop

I was trying to get each row data from a data table without using any loops

I’m trying this

string.Join(" ",dt1.Rows(0).ItemArray)
but as I’m only able to give one index value in .Rows() I’m only getting one row data
how can I get all the row

prefers if you show me how to do it using string.Join(" ",dt1.Rows(0).ItemArray)

I was thinking to add vblf after 0 in the .Rows(), like this (0,vblf) which in my opinion should give me each row , but as I can only pass index values I’m not able to pass vblf inside it

Please note !! i dont want data from a specific column, i want to get data from each row of each coulmn

use output datatable actiivty

in general we can use the output datatable activity for getting a string representation

With LINQ we can do

String.Join(Environment.newLine, dtVar.AsEnumerable.Select(Function (x) String.Join(“|”, x.ItemArray)))

1 Like

yes i tried this one , and getting the result too but im thinking can i able to do that witgout function

string.Join(" ",dt1.Rows(0).ItemArray)

unclear what is meant. Can you elaborate more on this? thanks

you are using function for this , im saying can i get the same output without using function

function (x) x is the lambda and essential within LINQ

[HowTo] LINQ (VB.Net) Learning Catalogue - Help / Something Else - UiPath Community Forum

when this is not wanted, then maybe LINQ is not matching your solution approach strategy and some other for us unknown factors are the drivers for a solution

1 Like

You can’t get it without a loop. Any solution loops. For Each Row loops, LINQ loops, Output Datatable loops. It’s impossible to get all the data from a datatable without looping.

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