Hi
Look at example from attachement, please. In test
InsertDoubleByCommandWithParam you could see problem with storing double
by command with parameter. We use Flags=BindAndGetAllAsText.
It works:
command.CommandText = "INSERT INTO EntA (Id, EntityProperty1,
DoubleProperty) VALUES (1, 'NaN', 'NaN'), (2, 'RegularDouble', '1.2'),
(3, 'PositiveInfinity', 'Infinity'), (4, 'NegativeInfinity',
'-Infinity')";
It doesn't work:
command.CommandText = "INSERT INTO EntA (Id, EntityProperty1,
DoubleProperty) VALUES (1, 'NaN', 'NaN'), (2, 'RegularDouble',
@doubleProp), (3, 'PositiveInfinity', 'Infinity'), (4,
'NegativeInfinity', '-Infinity')";
command.Parameters.AddWithValue("@doubleProp", 1.2);
I work on Win 8.1 EN with Polish local settings. If I change
command.Parameters.AddWithValue("@doubleProp", 1.2);
into
command.Parameters.AddWithValue("@doubleProp",
1.2.ToString(CultureInfo.InvariantCulture))
all work fine.
In my opinion command parameters should use InvariantCulture when
converting types to string.
Best Regards
Marcin Szotka - InstalSoft
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users