title: C# Float does not insert as exact value
body: <p>When inserting a float into a SQL Server database, I'm getting: </p>
  
  <pre><code>5.03000020980835
  </code></pre>
  
  <p>Which is not the exact value which is being gathered. </p>
  
  <p>How I'm gathering this float? Through a text box control to be converted to float </p>
  
  <p>How I'm working with the data currently: </p>
  
  <pre><code>   private void PayRateTextBox_TextChanged(object sender, EventArgs e)
     {
         PayRateBox = float.Parse(PayRateTextBox.Text);
     }
  </code></pre>
  
  <p>The above is setting an internal float to the current updated textbox which is set: </p>
  
  <pre><code> private float PayRateBox = 0;
  </code></pre>
  
  <p>Then inserted as: </p>
  
  <pre><code>string Query = "INSERT INTO shifts (ShiftDate,WeekNumber,Hours,PayType,Rate) " + 
                 "VALUES(@Date, @WeekNo, @Hours, @PayType, @Rate)";
  </code></pre>
  
  <p>and bound to the query via bound parameters: </p>
  
  <pre><code>CMD.Parameters.Add("@Rate", SqlDbType.Float);
  CMD.Parameters["@Rate"].Value = PayRate;
  </code></pre>
  
  <p>The default text in the TextBox is set to 5.03, so somewhere along the lines other data is being appended to make the overall value increment. I have tried to trace where this is happening, but cannot find out how and why this is happening. Perhaps I'm overlooking something? </p>