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