public void UpdateCust(DataGridView drv) { Datalayer dl = new Datalayer(); foreach (DataGridViewRow row in drv.Rows) { if (!row.IsNewRow) { dl.UpdateCust(row.Cells["SSN"].Value + "", row.Cells["Name"].Value + "", row.Cells["Phone"].Value + "", row.Cells["Email"].Value + ""); MessageBox.Show("Update Operation is Completed"); } } }