can anyone help on the Error
(From name As DataColumn In Excel_DT.Columns
select name.ColumnName
).ToArray()
Hi @devasaiprasad_K ,
Could you maybe try removing the As DataColumn and check if it works ?
You have made a small mistake in your linq expression, Change the linq as below,
(From row In dt1.Columns
Select row
).ToArray
Hope it helps!!
(From name In Excel_DT.Columns
Select name
).ToArray
Try this one… @devasaiprasad_K
nope some conversion Error
Do you want to store the column names in datatable in array right.
The Variable which is in the assign activity is Array of String.
If above will not work, then share the error you are getting… @devasaiprasad_K
i want to print the Datacolumn names and hence trying to store into an Array and print array Values
columnNames should of type arrayof string.
Excel_DT is your datatable
string[] columnNames = (from DataColumn name in Excel_DT.Columns
select name.ColumnName).ToArray()
Okay @devasaiprasad_K
→ Take an assign activity and create a Array of Object datatype variable called Arr_Columns.
→ In the other side of assign activity give the below linq expression,
- Assign -> Arr_Columns = (From name In Excel_DT.Columns
Select name
).ToArray
→ Then you can use the for each activity to loop through the Arr_Columns variable, inside for each insert write line activity to print each item in output panel.
Check the below workflow for better understanding,
Output in Output Panel -

Hope it helps!!
Change datatype of ColName1 array of object
thanks for the solution, it worked…
It’s my pleasure… @devasaiprasad_K
Happy Automation!!
You are over complicating things,
What you can do is just create a variable of type DataColumnCollection, and assign DtName.Columns
You’ll get the whole list of column names in there.
Sample Workflow:
GetDataColumnNames.xaml (9.9 KB)
Screenshot:
Thanks
Happy Automation!
Hi Executed the above code… simply superb.
Thanks a lot… for pitching in
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.








