List:MySQL and .NET« Previous MessageNext Message »
From:Chris Herridge Date:February 19 2007 1:06pm
Subject:RE: MySQL not taking a Double.MaxValue
View as plain text  
Hi,

Thanks for the reply;
but as i am testing the BO layer, i can't set the max value *in* MySQL
(it would stop the whole point of testing it)

if there is no way of making a .Net function to prepare the double value so
it will
certainly fit in the column, is there a way of stopping the warnings, so it
truncates the value silenty? (preferebly without switching STRICT off?)


thanks again guys,
Chris.



-----Original Message-----
From: Johan Steyn [mailto:jsteyn@stripped]
Sent: 19 February 2007 12:54
To: 'Chris Herridge'; dotnet@stripped
Subject: RE: MySQL not taking a Double.MaxValue


Hi There,

The declaration of a double is as follows:

DOUBLE(13,2) That gives the max length and precision of the field.

I don't know if this will help you in any way. So you set the max value for
the Double field in MySQl.

Johan.

-----Original Message-----
From: Chris Herridge [mailto:chris@stripped]
Sent: Monday, February 19, 2007 2:37 PM
To: dotnet@stripped
Subject: MySQL not taking a Double.MaxValue

Hi guys;

Just a quick question (I am busy writing unit tests for my Business Objects
system)
I've got a simple object that stores every CLR type and I'm going thru
testing it's min/max values;

so for example; (pseudo code)

INSERT INTO `TESTA`
(`boolean`,`byte`,`sbyte`,`char`,`decimal`,`double`,`enumdayofweek`,`float`,
`int16`,`int32`,`int64`,`uint16`,`uint32`,`uint64`,`texta`,`textb`,`textc`,`
textd`,`texte`)
VALUES
(?boolean,?byte,?sbyte,?char,?decimal,?double,?enumdayofweek,?float,?int16,?
int32,?int64,?uint16,?uint32,?uint64,?texta,?textb,?textc,?textd,?texte)


where
?double = Double.MaxValue;
it tells me it doesn't fit...

"Out of range value adjusted for column 'double' at row 1"

I've also tried;

?double = Double.Parse(Double.MaxValue.ToString("R"));
(I know that looks really quite stupid; but...)

also tried;

?double = Double.MaxValue-Double.Epsilon
(no luck there)


is there any logical method for fitting a Double into MySql
I'm using connector 5.0.3
and mysql 5.0.27 (community max nt)


or should I just lump it and store it as a string using .Tostring("R")
(which I really don't want to do!)

Can MySQL hold Double set to (+/-) Infinity too?


will i get exactly the same set of problesm with (Float/Single) too?


Thanks,
Chris Herridge.



--
MySQL on .NET Mailing List
For list archives: http://lists.mysql.com/dotnet
To unsubscribe:    http://lists.mysql.com/dotnet?unsub=1




Thread
New bugs category for Visual Studio pluginReggie Burnett25 Oct
RE: New bugs category for Visual Studio pluginDavid Dindorp26 Oct
  • Re: New bugs category for Visual Studio pluginMartin MC Brown26 Oct
RE: New bugs category for Visual Studio pluginDavid Dindorp26 Oct
  • RE: New bugs category for Visual Studio pluginReggie Burnett26 Oct
RE: New bugs category for Visual Studio pluginDavid Dindorp26 Oct
  • RE: New bugs category for Visual Studio pluginReggie Burnett26 Oct
RE: New bugs category for Visual Studio pluginDavid Dindorp27 Oct
  • Re: New bugs category for Visual Studio pluginBarry Zubel27 Oct
  • RE: New bugs category for Visual Studio pluginReggie Burnett27 Oct
    • MySQL not taking a Double.MaxValueChris Herridge19 Feb
      • RE: MySQL not taking a Double.MaxValueJohan Steyn19 Feb
      • RE: MySQL not taking a Double.MaxValueReggie Burnett21 Feb
RE: New bugs category for Visual Studio pluginYvan Rodrigues27 Oct
RE: New bugs category for Visual Studio pluginDavid Dindorp27 Oct
RE: New bugs category for Visual Studio pluginDavid Dindorp28 Oct
  • RE: New bugs category for Visual Studio pluginReggie Burnett29 Oct
RE: New bugs category for Visual Studio pluginDavid Dindorp9 Nov
  • RE: New bugs category for Visual Studio pluginReggie Burnett15 Nov
RE: MySQL not taking a Double.MaxValueChris Herridge19 Feb