How to Change the Type of a Column in a datatable from String to Number?

Hello All,

I need to change the type of a column in a datatable from String to int32.
In my use I have to insert the datatable into a database table and the database table expects only int32 values for few columns.

I cannot use balareva packages in my project. Hence Please suggest me any alternate way to achieve this task.

1 Like


May be you can do like once after writing the data to a excel then you can use this macro to change the column format


if you want to change it in datatable level itself as a int32 type then refer this

Cheers @Sirimalla_Karthik_Chandra

Hi @Palaniyappan , Thanks for replying to my post.

Using a Linq is a best approach for my usecase and I have to change the datatypes of more than 1 column. However I’m getting an error and I’m attaching the screenshot. I have gone through the entire thread but I didn’t understand how to handle the exception.

If possible could you please help me more in detail how to achieve my task.


In which activity you are getting this

Can you share the screenshot of that activity

Cheers @Sirimalla_Karthik_Chandra


See if the below video helps.