How to put array of data row into a data table?

datatable
uiautomation
activities

#1

thank you.


#2

@Venkatesh_Chowdary, Refer this,

Regards,
Dom :slight_smile:


#3

Hi @Venkatesh_Chowdary ,

Use add data row to add the data array into datatable.

Use for each to loop through the array of data row. And add the data into datatable.

Regards,
Arivu


#4

@Venkatesh_Chowdary

Datatable DT=DataRowArray_Variable.CopyToDataTable()

Regards,
Mahesh


#5

Hello Mahesh,

I want to ask you the opposite. I want to create array of strings for each row in Excel datatable and could not find appropriate post for it. Could you please help ?

Best,


#6

@oduzen001

Read Excel Sheet and store it in a datatable dta

Now create a Variable ABC which is of datatype List(Of List(Of Strings))

ABC = (From p In dta.Select
           Select p.ItemArray.ToList).ToList

p represents each row of datatable dta
and we are converting each row to a list of strings.
So ABC is List of List of strings.

So if you access ABC(0) you will get a list of strings which is of row 0.

Regards,
Mahesh