This is my current table array:
But I need convert into data table with header “Column1”
Please
Thanks
Shaik
This is my current table array:
But I need convert into data table with header “Column1”
Please
Thanks
Shaik
Use build data table and create a column
arr.Select(Function(a) dt.Rows.add(a.ToString)).copytodatatable
You can achieve the conversion from an array of strings to a DataTable using the Invoke Method
activity with the DataTable
class’s LoadDataRow
method. Here’s how you can do it without using a loop:
Select
method on the array of strings to convert it into an array of DataRow objects.Invoke Method
activity to call the LoadDataRow
method of the DataTable. This method will load the DataRow array directly into the DataTable.Thanks,
Ashok
can you provide invoke method please
thanks
shaik
Hi @shaik.muktharvalli1 ,
Step 1 : Use Build Data Table activity and set the header ‘Column1’ and Output in Properties pane to the Data Table Variable
Step 2 : Use an Assign Activity,
LHS : Data Table Vaiable (eg: dt_SampleTable)
RHS : (From x in StringArray Select r = dtResult.Rows.Add(new Object(){x})).CopyToDataTable
Or Method syntax:
stringArray.Select(Function (x) dtResult.Rows.Add(new Object(){x})).CopyToDataTable
Hope this helps you.
Happy Automating…!
if this helps you get the desired result, Please mark this as a solution.
Thanks,
Gautham.
Sorry don’t have studio on current machine but this is how you should configure the Invoke method.
Invoke Method activity:
Thanks,
Ashok
Columnname can be adapted afterwards as well
Assign Activity
dtVar.Columns(0).ColumnName = "Column1"