Try changing the lines where you set the parameter values from:
update.Parameters(0).Value = DataGridView1.Rows(i).Cells(0).ToString
to
update.Parameters(0).Value = DataGridView1.Item(i, 0).Value.ToString
or
update.Parameters(0).Value = DataGridView1.Rows(i).Cells(0).Value.ToString
Regards,
Johan