Inserting date from DataGridView into database?
<p>In my application, I have a dataGridview that has a column that gets its data from the database, and it represents a column of type date, there is a button when the user click it, it should insert the current select value of that column in another table that has a column of type date.
I tried doing this that way:</p>

<pre><code> private void btnInesrtDate_Click(object sender, EventArgs e)
        {
            string date = dataGridView1.CurrentRow.Cells[2].ToString();
            string sql = $"Insert Into BirthDates (Name, DateOfBirth)Values('{txtName.Text}','{date}')";
            conn.Open();
            SqlCommand command = new SqlCommand(sql, conn);
            command.ExecuteNonQuery();
            conn.Close();
            MessageBox.Show("Success");
        }
</code></pre>

<p>but I got an error says:</p>

<blockquote>
  <p>Conversion failed when converting date and/or time from character
  string.</p>
</blockquote>