7 messages in com.mysql.lists.dotnetAbout float fields
FromSent OnAttachments
Frank21 Dec 2004 16:40 
James Moore21 Dec 2004 17:32 
stre...@tiscali.it22 Dec 2004 00:33 
SGr...@unimin.com22 Dec 2004 06:35 
Jordan Sparks22 Dec 2004 07:11 
Patrick Questembert22 Dec 2004 07:35 
Frank22 Dec 2004 13:17 
Subject:About float fields
From:Frank (stre@tiscali.it)
Date:12/21/2004 04:40:40 PM
List:com.mysql.lists.dotnet

I have a float field in a table and I'm experimenting some updates using a
DataGrid and a MySqlCommanBuilder. If the field assumes some particular values
(ie. 2.24) I get a concurrency error when I send the UPDATE query to the server.

After some research I found that this particular value is probably not handled
with the exact value by the server on a float type field, because of the
approximation applied by the system on loating point numbers which every
programmer knows of (it's late night and I'm too lazy to try the math :-) ).

The problem is that the CommandBuilder creates the UPDATE command string
including the value of the float field in the WHERE part (... WHERE 'fld_1'=1
AND 'float_fld'=2.24). This causes the query to not find the row and then return
0 rows which cause the concurreny error in .NET.