Data Row variable to csv

Hello,

How to pass datarow variable to write the data in csv file.

Pls suggest.

You can only write data table to csv or excel but not data row.
So you can create a new data table and add this data row to a data table and then export to csv.

Regards,
Karthik Byggari

1 Like

Create a Datatable and Add your Datarow, after that write it to CSV File.

@KarthikByggari @asesor-rpa

Thanks for the response.

I did the same but somehow it is not working. Pls assist.

can you try like this, i hope that will work.

  1. convert your datarow to String Array
  2. then use String.join to create string
  3. use append line append this string to file

String Array s = datarow.itemarray
String Datarow = string.join(',", from r in s select)