Column not coming in string in excel

I have used build data table in which rollno ,i kept string
i add data row
i have again convert that column to string

but still column is coming in int

If the values you put in the column are numbers, then excel automaticaly format them as numbers (move them to the right side in the cell. etc.)
If you want to make sure excel does not do this, you could add ’ before the value you put in the cell

so in code you would also have to do this same behaviour

can u please provide screenshot

If possible can I have a view on the build datatable activity wizard that displays is the column name and Datatype

i have used string in that activity

but still im getting int datatype

May I know how you are telling that
Cheers @Ananya1

by checking downloaded excel sheet

datatable has two columns of string
and in add row I add two strings
“'123” and “text”

hmm…it would enter as string only if the column we create is of type string
i wonder why so
what is the value mentioned for Rollno column
Cheers @Ananya1

254 but its int not string

System Argument Exception: Input array is longer than the number of columns in this table.

how many columns does your dataTable have
You should make sure the part besteen {} has the same number of elements
so for 1 column {“'1”}
for 3 {“'1”, “'2”, “'3”}

4 column
2nd column should be string
plz share screenshot

i did this


could you sare a screenshot of how your datatable is build?


That is how you assign the value to the datatable
if in_MasterRow(“rollno”).ToString is a number (even when you cast it to string excel will think 123 is a number) you should do it a bit diverent if you want it to look like as string in excel
{in_sub, “'” + in_MasterRow(“rollno”).ToString, in_marks, in_grade}

What I was wondering is how your datatable looked like, to make sure the datatable columns have the datatype I am expecting them to have.
something like this

im getting same error

Thanks ,Its solved

i have 5 columns
{in_srno,in_sub,“'” +in_MasterRow(“rollNo”).toString,In_marks,in_Grade)

but sr_no is not getting updated

Glad it is resolved