| List: | MySQL and .NET | « Previous MessageNext Message » | |
| From: | Guy Platt | Date: | February 11 2005 11:21am |
| Subject: | Decimal point being changed ot decimal Comma by MySqlComman:Command text | ||
| View as plain text | |||
Hi,
I'm running 1.0.4 and have encountered something strange.
The following code crashes on the ExecuteQuery with a SQL error.
fundShare = Convert.ToDecimal(( (allocationPerc / 100) * oldSum ) / fundValue));
fundShare = Math.Round(fundShare,2);
myCmd.CommandText = "INSERT INTO performance_detail (FundNr, FundShare) VALUES ('"+ fundNr
+"','"+ fundShare +"')";
myCmd.ExecuteNonQuery();
Checking under debug fundShare contains the value "95.66" but the CommandText shows this
value as "95,66". I presume that it is a case of .NET storing the decimal with a
placeholder or a decimal point, but when it is given to the CommandText the value is
converted to show a decimal comma (which causes MySql to crash).
Can anyone tell me how to overcome this?
thanks
Guy
| Thread | ||
|---|---|---|
| • InnoDB error | nil18 | 9 Feb |
| • Re: InnoDB error | Jorge Bastos | 9 Feb |
| • Re: InnoDB error | SGreen | 9 Feb |
| • Re: InnoDB error | Jorge Bastos | 11 Feb |
| • Decimal point being changed ot decimal Comma by MySqlComman:Commandtext | Guy Platt | 11 Feb |
| • Re: Decimal point being changed ot decimal Comma by MySqlComman:Commandtext | Guy Platt | 11 Feb |
| • RE: Decimal point being changed ot decimal Comma by MySqlComman:Command text | Jordan Sparks | 11 Feb |
| • RE: Decimal point being changed ot decimal Comma by MySqlComman:Command text | Reggie Burnett | 23 Feb |
| • Ann: MyGeneration supports MySQL through the MySQL Connector/Net provider | mike.griffin | 23 Feb |
| • RE: MyGeneration supports MySQL through the MySQL Connector/Net provider | Reggie Burnett | 23 Feb |
| • Re: InnoDB error | SGreen | 9 Feb |
