title: How to insert decimal value from textbox into database with c#
body: <p>I'm using a SQL Server database and Windows Forms application. I have 2 textboxes and 1 combobox. Users inputs their name and working rate into the textboxes and they chose year from combobox. I try to insert those values into my database.</p>
  
  <p>EX:</p>
  
  <pre><code>2018    Mike    39,72     WORKERS
  </code></pre>
  
  <p>In database:</p>
  
  <pre><code>year --&gt; nvarchar(4)
  name --&gt; nvarchar(50)
  rate --&gt; decimal(18,2)
  type --&gt; nvarchar(50)
  </code></pre>
  
  <p>My code is like:</p>
  
  <pre><code>SqlCommand cmd = new SqlCommand("INSERT INTO USERS(YEAR,NAME,RATE,TYPE) VALUES ('" + yearcombo.Text + "','" + name.Text + "','" + Convert.ToDecimal(rate.Text, CultureInfo.CurrentCulture) + ",'" + "WORKERS" + "')", connection);
  </code></pre>
  
  <p>I get this error:</p>
  
  <blockquote>
    <p>There are fewer columns in the INSERT statement than values specified in the VALUES clause. The number of values in the VALUES clause must match the number of columns specified in the INSERT statement.</p>
  </blockquote>