How to convert Data Row into List

Hi,
Can anyone let me know how to convert Data Row into List.
I used the Read Row activity to get the row data which is of type IEnumerable. While trying to convert it to a list it is throwing an error saying “list of an object cannot convert into a list of string”.

Thanks in advance.

@Kavya_Mamidishetti2

Use multiple Add To Collection activities depends on number of columns you have and pass all row values. Then Row will be converted to List.

2 Likes

@Kavya_Mamidishetti2
give a try on following

myStringList | DataType: List(of String)

Assign acitvity
Left: myStringList
Right: myReadRowOutput.Select(Function (x) x.ToString).toList

2 Likes

You are almost done

Mention like this
row.ItemArray()

This will give the row data as a array of string

To convert it as a list

row.ItemArray().ToList()

Hope this would help you resolve this

Cheers @Kavya_Mamidishetti2

3 Likes

@Palaniyappan Thanks for your response. Output variable for ReadRow is (Let’s say opReadRow)
Where to mention this row.ItemArray().ToList

Thanks.It worked.

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