I have a sql field (MSDE 2000) of type Decimal. When inserting a value into
the field from an asp.net web form I am using the CDec() function. If I
enter a 2.1 through a 2.4 a 2.00 is entered into the database. If I enter a
2.5 through a 2.9 a 3.00 is entered into the database???? Here is the stored
procedure I'm using and a vb.net code snippet:
-------------------------------------------------------
CREATE PROCEDURE dbo.UpdateHoursEstimate
(@MainID INT, @NewHoursEstimate DECIMAL)
AS
UPDATE tblMain
SET EstimatedHours = @NewHoursEstimate
WHERE MainID = @MainID
GO
---------------------------------------------------
----------------------------------------------------
<snippet>
Dim Param_NewHoursEstimate As New SqlParameter("@NewHoursEstimate",
SqlDbType.Decimal)
Param_NewHoursEstimate.Value = CDec(txtEstimatedHours.Text)
.Parameters.Add(Param_NewHoursEstimate)
</snippet?
----------------------------------------------------
I have entered data directly into the table without issue. So I know the sql
table accepts and stores the numbers I expect. Where is this rounding taking
place?
any info is appreciated. Thanks.