In C #, I am using decimal DbParameter for the Sql server stored procedure. I create such a parameter
DbParameter prm = comm.CreateParameter(); prm.ParameterName = "@Price"; prm.DbType = DbType.Decimal; prm.Direction = ParameterDirection.Output; comm.Parameters.Add(prm); //and set the value of comm.Parameters["@Price"] to a variable, decimal.TryParse(comm.Parameters["@Price"].Value.ToString(), out this.ProdPrice);
But the value of the out parameter is always rounded.
If I call the same stored procedure from Sql Server Management Studio, I can get its parameter correctly with it accuracy
There are no precision or scaling properties in DbParameter. And I have to use DbParameter in the System.Data.Common namespace to retrieve the data
How can I get the decimal value with full precision
Thanks in advance...
source share