Hello Everyone,
Need help with a quick linq query to convert selected string columns into interger type and store in a datatable variable
Hello Everyone,
Need help with a quick linq query to convert selected string columns into interger type and store in a datatable variable
Hi @krishna_r
Please try this:
Assign activity:
datatableOutput = (From row In datatableInput.AsEnumerable()
Select datatableInput.Clone().Rows.Add(row.ItemArray.Select(Function (x) If(IsNumeric(x.ToString.Trim),Convert.ToInt32(x.ToString.Trim),x)).ToArray())).CopyToDataTable()
Hope this helps,
Best Regards.
error message: is numeric is not declared
A column defining a datatype of String cannot be populated with an int32
define a third column - e.g. colname Col3
populate it with usage of
Then delete Col2
Rename Col3 to Col2
page unavailable.
Can you please elaborate
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.