I cannot insert decimal values ββinto the Sql server table.
What I'm trying to do explains itself through these lines of code:
long fileSizeInBytes = ComponentUploadControl.FileContent.Length;
Decimal fileSizeInMB = Convert.ToDecimal(fileSizeInBytes) / (1024.0m * 1024.0m);
Decimal fileSizeInMBRounded = Math.Round(fileSizeInMB, 2);
cmd.Parameters.Add("@fileSize", SqlDbType.Decimal).Value = fileSizeInMBRounded;
The value inserted into the database is not decimal. To be more specific, if fileSizeInMBRounded is 11.73, the value that gets into the database is 11.00
Please help me
Thanks pending
source
share