User-73514677 posted
Hi.
I have a datarow which contains value as $2,065,890.15
I am trying to pass the data to SQL table having column type as float. I did the below code:
if (!string.IsNullOrEmpty(row[1].ToString()))
{
row[1] = Decimal.Parse(row[1].ToString(), NumberStyles.Currency, CultureInfo.InvariantCulture);
}
I am getting the error as - Input string was not in correct format
Update1: the issue seems to be with characters , .
I was able to remove the , ( comma ) character with the replace. How to work with the decimal ?
How to fix this ?
Thanks