I'm not sure what's going on here, but whatever it is, I don't like it.
I have an .aspx page that inserts data into a table. The field in question is a decimal field (I've also tried float and numeric, with the same results). When I look at the data that the page says it's sending, I see decimal values, but when the data is inserted into the table, it's rounding everything up. 5.5 is 6, 9.5 is 10, etc.
I'm sending the values as decimal parameters to the stored procedure, and doing a straight insert from there.
Is there another way I can verify that the SP is actually receiving what the C# says it is? I've tried PRINT, but nothing comes out (I'm assuming because it's a decimal value).
Thanks!
tigerjade
"Always code as if the person who ends up maintaining your code will be a violent psychopath who knows where you live." -- Martin Golding
I'm sending the values as decimal parameters to the stored procedure, and doing a straight insert from there.
Code:
SQL:
ALTER PROCEDURE sp_holdConfigurationData
@Current1 decimal
,@Current2 decimal
AS
INSERT INTO ButtonTemp (Current1, Current2) VALUES (@Current1, @Current2)
Code:
Snippet of C#:
SqlParameter Current1SubParam = new SqlParameter("@Current1",SqlDbType.Decimal);
Current1SubParam.Value = Current1Sub;
AddToTempCmd.Parameters.Add(Current1SubParam);
Is there another way I can verify that the SP is actually receiving what the C# says it is? I've tried PRINT, but nothing comes out (I'm assuming because it's a decimal value).
Thanks!
tigerjade
"Always code as if the person who ends up maintaining your code will be a violent psychopath who knows where you live." -- Martin Golding