private void checkBox2_CheckedChanged(object sender, EventArgs e) { if (checkBox2.Checked == true) { if (dataGridView2.Rows.Count > 0) { string temp = dataGridView2.Rows[dataGridView2.SelectedCells[0].RowIndex].Cells[0].FormattedValue.ToString(); string ativ = "sim"; DALCadastro.Inativa_Contas_Corrente(temp, ativ); MessageBox.Show("Conta Ativa"); dataGridView2.DataSource = DALCadastro.Lista_Contas_Corrente("0"); } } if (checkBox2.Checked == false) { if (dataGridView2.Rows.Count > 0) { string temp = dataGridView2.Rows[dataGridView2.SelectedCells[0].RowIndex].Cells[0].FormattedValue.ToString(); string ativ = "não"; DALCadastro.Inativa_Contas_Corrente(temp, ativ); MessageBox.Show("Conta Inativa"); dataGridView2.DataSource = DALCadastro.Lista_Contas_Corrente("0"); } } }