C# Update Database for every DataGridView Row
<p>I want to update a Table in Database for every row in the DataGridView by using a Update button. Here's The following Update Button Code :</p>

<pre><code>private void btUpdate_Click(object sender, EventArgs e)
{
    SqlConnection cn = new SqlConnection(con);
    cn.Open();
    SqlCommand cmdUpdate = new SqlCommand("UPDATE OINV SET U_IDU_HFP = @HFP, U_IDU_FAKTURPAJAK = @FP, U_IDU_FPDATE = @FPDATE WHERE DocEntry = @DocEntry;", cn);
    foreach (DataGridViewRow item in dgvInputPKP.Rows)
    {
        cmdUpdate.Parameters.AddWithValue("@HFP", item.Cells[10].Value);
        cmdUpdate.Parameters.AddWithValue("@FP", item.Cells[11].Value);
        cmdUpdate.Parameters.AddWithValue("@FPDATE", item.Cells[9].Value);
        cmdUpdate.Parameters.AddWithValue("@DocEntry", item.Cells[1].Value);
        cmdUpdate.ExecuteNonQuery();
    }
    MessageBox.Show("Record Updated Successfully");
    cn.Close();
}
</code></pre>

<p>When I press the Update Button <strong>only the 1st row from DataGridViews was Updated Succesfully</strong> in the Database, <strong>but not with the other rows</strong>.
It also return some error with following detail:</p>

<blockquote>
  <p><em>The variable name '@HFP' has already been declared. Variable names must be unique within a query batch or stored procedure.</em></p>
</blockquote>

<p>I was try to searching and googling but never find the right one.</p>

<p>Please help me to fix this issue. 
Thanks.</p>