I need simple condition to replace this (incomplete) if
condition.
// i dont want to write all possible data types
if (col.DataType == typeof(int) || col.DataType == typeof(int64) ... all types)
{
// i want to do something on numeric columns
// (convert all numbers to double datatype)
}
else
{
// string and other non-numbers will remain unchanged
}
I was trying something like this:
col.DataType.IsNumeric()
but there is no such method in that class.
I cant use TryParse()
method on data because there is too much data.
Condition must be determined only by DataTable column datatype property.
Is there any simple method to simplify my if
?