Convert DataTable Column to String Array




I am attempting to convert a DataTable Column into a String Array but find no easy way to do this.

Would anyone have suggestions?

Thanks in advance!



Try like this,

List(of string) = (From row in dt.AsEnumerable() Select Convert.Tostring(row(“ColumnName”))).ToList()

replace the “ColumnName” with your datatable column name or use index of the column.


Thank you sarathi125 for your response!

Your suggestion worked nicely. The only thing I changed was ToList() --> ToArray()