private void button2_Click(object sender, EventArgs e) { _ProductDal.update(new Product { Id = Convert.ToInt32(dataGridView1.CurrentRow.Cells[0].Value), Name = textBox1.Text, UnitPrice = Convert.ToDecimal(textBox2.Text), StockAmount = Convert.ToInt32(textBox3.Text) }); LoadProducts(); MessageBox.Show("updated!"); }