Hello,
I have this problem with decimal numbers of a form. When i update the db table the number in the textfield rounds. For example if i enter 2,4 value after updating the record i get 2,0.
I use sproc with decimal fields for update.
(If i enter the value straight to SQL Server table, i get the correct value).
Any suggestions?
Thank you in advance.
Loading

naura paxRank #2,843 · 502 reputationPosted Nov 4, 2009, 8:49 PM EST
Another problem that i could think of is in the Stored Procedure you might have not declared parameter with right datatype eg:
alter procedure saveInventory
@itemid int,
@quantity int -- it should be decimal(18,3).
Saulius7 reputationPosted Nov 4, 2009, 7:15 AM EST
naura paxRank #2,843 · 502 reputationPosted Nov 4, 2009, 8:37 PM EST
Then the problem could be in the way you are passing parameter in frontend (or in BLL or DAL layer if you have defined them).
At the time of calling stored procedure and adding parameter in ado.net command object code you have to specify data type in that case you might have written Db.Int32 now use Db.Decimal instead if that is the case.
hope i'm clear
Kirtan PatelRank #292 · 8.6K reputationPosted Nov 5, 2009, 1:46 AM EST
Which Data Type you have used in database ???? for storing those numbers ??
provide the code which you are using to insert the values
DealyRank #9,518 · 205 reputationPosted Nov 5, 2009, 2:18 AM EST
Thank you for the solution