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 paxPosted Nov 5, 2009, 1:49 AM
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).
DealyPosted Nov 5, 2009, 7:18 AM
Thank you for the solution
Kirtan PatelPosted Nov 5, 2009, 6:46 AM
Which Data Type you have used in database ???? for storing those numbers ??
provide the code which you are using to insert the values
naura paxPosted Nov 5, 2009, 1:37 AM
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
SauliusPosted Nov 4, 2009, 12:15 PM