I'm using the following SQL Server stored procedure in one of my C# projects.
create procedure [dbo].[TestRecordSelect]
@OMarks numeric(3,1) output
as
begin
select @OMarks = isnull(sum(cast(OMarks as numeric(3,1))),0) from Marks
end
and I'm getting the desired result i.e. 24.9 when executing the procedure in SQL Server. But when I'm using the same procedure in my C# project and calling the @OMarks as follows
cmd.Parameters.Add("@OMarks", SqlDbType.Decimal).Direction = ParameterDirection.Output;
tbomarks.Text = cmd.Parameters["@OMarks"].Value.ToString();
I'm getting 25 instead of 24.9 that is the rounded up data.
My problem is I don't want to get 25. I want to get 24.9 in tbomarks