Column "xxxx" does not belong to the table DataTable error is thrown

Please find the attached screenshot.

I am trying to the feed the data from CSV file in to the textboxes in an application. Few fields do work successfully but i see this error for few fields.

Hi @Aaditya
For the datatable try to initialize the value as new Datatable() and check it again

or check whether add headers are enabled in read range

Ashwin S


The Column LASTCOMPANY NAME not available in that datatable, that could be a name spell mistake, check that. As a best practice do not have space in the header of tables.

try passing row index value instead of ColumnName

Ashwin, Thanks for the quick response.

Iam using read CSV not read range. Should i switch to Read Range ? is it a better way to achieve my purpose ?

has headers checkbox is enabled.

“For the datatable try to initialize the value as new Datatable() and check it again” :- how to do this ?

The spelling is right and i even tried removing the spaces…no luck

It did pick few column names in the same script but failed in few. I might be missing out something…

it should work if not row(“yourcolumnname”).ToString this
this has to work row(0).ToString

Hi @sarathi125
use read csv activity and datatable value in variable pane give the value as new Datatable()

Ashwin S


You can try yourDT.Columns(aColumnNumber).ColumnName.ToString to check what headers are being read.

1 Like

Thanks !! this worked easily…

1 Like

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