Get datatable headers as array/item array

Hi All ,

I need to get column names / headers in an array

Any function available for this

Hi @Swathi_U

Check this out

DT.Columns.Cast(Of DataColumn).Select(Function(x)x.ColumnName).ToArray

DT is your datatable

Thanks

1 Like

Thanks @nikhil.girish

Will check this

Hey @Swathi_U ,

You can refer this thread How to get column names of data table to an array?

Thanks,
Sanjit

1 Like

Sure sanjit :slight_smile:

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