#35 problem with double types

open
nobody
None
5
2009-05-11
2009-05-11
Anonymous
No

Datareader throws exeption "Input string was not in a correct format." if the decimal separator of double types is not a dot (.) in your your localization settings.

Solution:

in MySQLDataAdapter.css at around line 175 there is a line with
dr[(int)i] = Convert.ToDouble(val);
you can rewrite with this:
dr[(int)i] = Convert.ToDouble(val, MySQLNumberFormatInfo);

where MySQLNumberFormatInfo is a System.Globalization.NumberFormatInfo MySQLNumberFormatInfo = new CultureInfo("en-US").NumberFormat;

Discussion