title: Insersting Decimal-Values into an access-database using c# and INSERT INTO
body: <p>I have a problem with converting string into decimal which is "," seperated. I write some values like 23,4 mm into a textbox. After that I click on the button and want the values to be converted to decimal and after that be inserted into my access- database.</p>
  
  <p>For the whole process I am using the following code:</p>
  
  <pre><code> int auftragsnummer, rolle, maschinenfuehrer, prueferin, maschine ,werk; double  mw_1, mw_2, mw_3;
          Int32.TryParse(mf_id.Text, out maschinenfuehrer);
          Int32.TryParse(lab_id.Text, out prueferin);
          Int32.TryParse(masch.Text, out maschine);
          Int32.TryParse(kund_id.Text, out werk);
          Int32.TryParse(auftrag.Text, out auftragsnummer);
          Int32.TryParse(Rolle.Text, out rolle);
          Double.TryParse(textBox2.Text, NumberStyles.Any, CultureInfo.CurrentCulture, out mw_1);
          Double.TryParse(textBox1.Text, NumberStyles.Any, CultureInfo.CurrentCulture, out mw_2);
          Double.TryParse(textBox3.Text, NumberStyles.Any, CultureInfo.InstalledUICulture, out mw_3);
          con.Open();
          OleDbCommand cmd = con.CreateCommand();
          cmd.CommandType = CommandType.Text;
          cmd.CommandText = "INSERT INTO GLri (Auftragsnummer, Rolle, Mf, Prueferin, Maschine, Werk, Messwerteins, Messwertzwei, Messwertdrei ) values(" + auftragsnummer + "," + rolle + "," + maschinenfuehrer + "," + prueferin + "," + maschine + "," + werk + "," + mw_1 + "," + mw_2 + "," + mw_3 + ")";
          cmd.ExecuteNonQuery();
          con.Close();
  </code></pre>
  
  <p>For inserting into my access-database I am using the INSERT INTO instruction. However when I write the vlaue  23,2 "," seperated and want to insert it, I get an error that said, that my database-table has not enough columns. When I seperate the values with a dot, it inserts the values into my database not as a decimal value. For example:I write 22.4 in my textbox and the program inserts 224 into my database-table. </p>
  
  <p>Those columns, which have to be in decimal,  are already declared as decimal. </p>
  
  <p>Is anyone able to help me out with this issue? I am not able to detect my mistake.</p>
  
  <p>By the way, is it the right way to use the sql-command as I do?</p>
  
  <p>Thank you very much!</p>