title: Sending the value people input in DataTable in C# to microcontroller
body: <p>I'm trying to send the value which people input from DataTable to microcontroller, but when I check again by TeraTerm the value in microcontr., the result I get is wrong.</p>
  <p>The image : <img src="https://i.stack.imgur.com/bWFvq.png" alt="enter image description here" /></p>
  <p>Here my code for grid init:</p>
  <pre><code>private void Form1_Load(object sender, EventArgs e)
  {
      //Data table
      DataTable table = new DataTable();
  
      //Column
      table.Columns.Add(&quot;TPS&quot;);
      table.Columns.Add(&quot;500&quot;, typeof(float));
      table.Columns.Add(&quot;750&quot;, typeof(float));
      //Row
      table.Rows.Add(&quot;100%&quot;);
      table.Rows.Add(&quot;95%&quot;);
      table.Rows.Add(&quot;90%&quot;);
  
      //Data Grid View
      dtGridView.DataSource = table;
  
      //Set width
      dtGridView.Columns[0].Width = 40;
      dtGridView.Columns[1].Width = 40;
      dtGridView.Columns[2].Width = 40;
  
  }
  </code></pre>
  <p>And the sending:</p>
  <pre><code>private void btnSend_Click(object sender, EventArgs e)
  {
      try
      {
          for (int i = 0; i &lt; dtGridView.Rows.Count; i++)
              for (int j = 0; j &lt; dtGridView.Columns.Count; j++)
              {
                  object o = dtGridView.Rows[i].Cells[j].Value;
  
                  if (P.IsOpen == true)
                  {
                      P.WriteLine(o.ToString());
                      MessageBox.Show(&quot;Write succesfully!&quot;);
                      P.Close();
                  }
              }
      }
      catch(Exception ex)
      {
          MessageBox.Show(&quot;Unable to write to COM port&quot;);
      }
  }
  </code></pre>