public void Updatemodel(DataGridView drv) { Datalayer d1 = new Datalayer(); foreach (DataGridViewRow row in drv.Rows) { if (!row.IsNewRow) { d1.Updatemodel(row.Cells["Company_Name"].Value + "", row.Cells["Mod_Name"].Value + "", row.Cells["Mod_Quantity"].Value + "", row.Cells["Mod_Sell_Cost"].Value + "", row.Cells["Ram"].Value + "", row.Cells["CPU"].Value + "", row.Cells["Internal_Storage"].Value + "", row.Cells["Screen_Size"].Value + "", row.Cells["Primary_Camera"].Value + "", row.Cells["Secondry_Camera"].Value + ""); MessageBox.Show("Update Operation is Completed"); } } }