Convert Datatable of a column values to Array

Hi there, can you help me with how to convert the datatable column to array type.

i have a datatable with 30+ columns and 5000 rows. I have a column named “TAX ID” which used in a macro. I need to pass Array of string.
I can not use For each activity because it consume more time. (also the rows keep extending day by day)

can you please help me on how we can achieve this without for each?

Hello @gopal_ram , You can use LINQ query. It doesnt use concept of FOR EACH

Try below code :

(From row in dt.AsEnumerable select cstr(row("TAX ID"))).toarray()

Here is screenshot : Ignore FOR EACH i used. It just to print the Array value

1 Like

, thanks this worked

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