How to convert Data Column from String to Int64?

Hello everyone,

I have a datatable with three string columns (id, price, total). I need to convert just the column total to int64 so i can merge this table with another with the same types.

PS: i can’t use external packages.

1 Like

@snapval
Int64.parse(total) would do this conversion

1 Like

Hi,

Hope the following sample helps you.

dt = dt.AsEnumerable.Select(Function(r) dt.Clone.LoadDataRow({r("id"),r("price"),r("total"),Int64.Parse(r("total").ToString())},False)).CopyToDataTable()

Sample20221206-2.zip (2.9 KB)

Regards,

2 Likes

You are a genius, thank you!

1 Like

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