title: Unable to insert decimal to sql server table through c# code
body: <p>I'm not able to insert decimal values into Sql Server table.</p>
  
  <p>What i'm trying to do is self explanatory through these lines of code:</p>
  
  <pre><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;
  </code></pre>
  
  <p>The value that is getting inserted into database is stripped of the decimal places. To be more specific if the fileSizeInMBRounded  is 11.73, the value that is getting inserted into database is 11,00</p>
  
  <p>Please help me</p>
  
  <p>Thanks in anticipation</p>