title: How to transfer data with selected checkbox in datagrid after button click? C# and SQL Server
body: <p>I have 2 tables namely <code>Pending.dbo</code> and <code>Approved.dbo</code>. I have used tabcontrol. The first tab contains <code>"Pending datagridview"</code> with <code>checkbox</code> and <code>btnApprove</code>. The second tab named <code>"Approved"</code> is just a read-only datagridview. </p>
  
  <p>What I want is that when I click <code>btnApprove</code>, the data selected by <code>checkbox</code> in <code>"Pending datagridview"</code> will transfer to the table <code>Approved.dbo</code>. </p>
  
  <p>Is it possible? As of now, this is my codes: </p>
  
  <p><code>language: c#</code></p>
  
  <pre><code>private void btnApproved_Click(object sender, EventArgs e)
      {
          //List&lt;DataGridViewRow&gt; selectedRows = (from row in dataGridView1.Rows.Cast&lt;DataGridViewRow&gt;() where Convert.ToBoolean(row.Cells["checkBoxColumn"].Value) == true select row).ToList();
          foreach (DataGridView row in dataGridView1.Rows)
          {
              using (var connect = sqlcon.getConnection())
              {
                  using (SqlCommand cmd = new SqlCommand("COMMAND TO TRANSFER DATA??????"))
                  {
  
                  }
              }
          }
      }
  </code></pre>
  
  <p>PS. Sorry for my bad english and explanation. Thanks!</p>