Is there a way to convert datatable's row datatype?

Hi folks,

I have a datatable with Dynamic Column Index and Fixed Row Index.

I want to convert all of Row Index 10’s value from string to int.
How to achieve this in most efficient way?

for the conver i can only think about Cint().

Hey @wija

Actually we can’t convert the type row wise but we can instead do it column wise ?

Kindly explain now if that is what you are looking for ?

Also, what is the business case here…


hmm but my column index is dynamic, can u do it?

Hi @wija
First count the number of columns in DataTable by using dt.columns.count
Then use the Do or while loop and For each Row and convert from String to Int by using Assign activity

i think this is converting datatable column’s value datatype, not converting datatable’s column datatype hmm.

Hi @wija ,

I think in order to Convert Datatable’s Column Data Type we would require to Create/Build a Similar Datatable with Same Column Names with the Required Data type and Either Loop through the Input Datatable and Update the new Datatable Created or Use a Linq Query to Update the new Datatable.

Also, Here you mention you would want to convert all of row index values, meaning all columns of that particular row. There isn’t a Defined Dynamic Column Index.

Maybe explaining to us what is your actual requirement for converting the particular row values data type would help us further to Suggest you better solutions.

1 Like

Hi @wija
I think this will work for you
use Balareva.easydatatable.actvities packages, in that you will be having change column datatype activity and give the input datatype that u needed
i checked and it’s working fine. Use the loop for dynamic column index


Kindly Mark as solution if its worked for you

never mind guys, i found my own solution just now :slight_smile:

Hii @wija
Can u post the solution which you have developed so it might be helpfull to me and others. Kindly Close the thread after posting the solution.