private void button1_Click(object sender, EventArgs e) { for (int i = 0; i < dataGridView1.Rows.Count; i++) { dataGridView1.Rows[i].Cells[7].Value = Convert.ToInt32(dataGridView1.Rows[i].Cells[2].Value) + Convert.ToInt32(dataGridView1.Rows[i].Cells[3].Value) + Convert.ToInt32(dataGridView1.Rows[i].Cells[4].Value) + Convert.ToInt32(dataGridView1.Rows[i].Cells[5].Value) + Convert.ToInt32(dataGridView1.Rows[i].Cells[6].Value); } }
Logo SQL
Comments are closed