Get first cell of a Datatable with headers

Hi does anyone know how to get the first cell of a datatable? I’m looking for the cell A1 (which is a column name in this case because I have headers) not the first item of the datatable.

@inyourgravity, Assign activity

String strFirstColName = (From col in dt.Columns.CastOf(System.Data.DataColumns)
Select Cstr(col.columnName)).Tolist()(0)

Dom :slight_smile:

HI @inyourgravity,
use the below code to get first column name from the data table.


1 Like

If you read it from an excel file you can just use ReadCell activity indicating cell A1 or if you already have the DataTable, the easiest way is: