Sql Compact Edition/SQLCE problems inserting float or single with SqlCeUpdatableRecord
Posted by craig
Monday, May 11, 2009 4:18:28 AM
I have found problems using the following code:
Couldn't store (System.Data.SqlTypes.SqlSingle) in column (myFloatColumn). The expected data type is Float.
myFloatColumn is defined as a float in the schema.
Could not find any information on the internet. However a workaround I found was to simply use the function SetValue as follows:
rec.SetValue(0,myFloatValue);
SetValue takes an object as the second parameter, so there may be some boxing overhead. However it solved my problem.
The boxing may be important because typically SqlCEUpdatableReord is used for performance during TableDirect inserts.
Copyright 2009 AnyTime