S
Stropher
Hi!
I just want to update a column in a table having a value of a decimal
number.
Then I tried this via sql-query analyzer
update tablepost set preis = 0.71 where idnumber = 50
It worked well.
Then in my c# program, I tried the same: but first of all
command = "update tablepost set preis = 0.71 where idnumber = 50";
//I passed it as a paramter for a given method:
This also functioned well and stored the right value.
Then I tried these:
decimal preis = 0.71;
command = "update tablepost set preis = " + this.preis + " where
idnumber = 50";
It did not compile, then I added:
command = "update tablepost set preis = convert(decimal(28,2)," +
this.preis + ")where idnumber = 50";
It compiled, but instead of 0.71, it stored 0, when I give 32.8 it
stores 32.
In customized regional numbers I have:
Decimal symbol: ','
No. of digits after decimal: '.'
And for the tablepost - preis, I do have
decimal (as datatype), 28 and 2 for accuracy and decimal places
respectively.
Can anyone give me some tips, how to go about this...
Lest I forget, I can select from tables returning back decimal numbers
without any problem
Thanks in advance.
Stropher
I just want to update a column in a table having a value of a decimal
number.
Then I tried this via sql-query analyzer
update tablepost set preis = 0.71 where idnumber = 50
It worked well.
Then in my c# program, I tried the same: but first of all
command = "update tablepost set preis = 0.71 where idnumber = 50";
//I passed it as a paramter for a given method:
This also functioned well and stored the right value.
Then I tried these:
decimal preis = 0.71;
command = "update tablepost set preis = " + this.preis + " where
idnumber = 50";
It did not compile, then I added:
command = "update tablepost set preis = convert(decimal(28,2)," +
this.preis + ")where idnumber = 50";
It compiled, but instead of 0.71, it stored 0, when I give 32.8 it
stores 32.
In customized regional numbers I have:
Decimal symbol: ','
No. of digits after decimal: '.'
And for the tablepost - preis, I do have
decimal (as datatype), 28 and 2 for accuracy and decimal places
respectively.
Can anyone give me some tips, how to go about this...
Lest I forget, I can select from tables returning back decimal numbers
without any problem
Thanks in advance.
Stropher