private void btnDel_Click(object sender, EventArgs e) { string name = comboBox1.Text; string pole = "[Код "+name+"]"; connection conDel = new connection(); conDel.delete(name, pole, Convert.ToString(dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells[0].Value)); dataGridView1.DataSource = connection.FillDGV("*", comboBox1.Text); }
private void button2_Click_1(object sender, EventArgs e) { string pole = "[Код " + tabControl1.SelectedTab.Text + "]"; connection conDel = new connection(); if (tabControl1.SelectedTab.Text=="Успеваемость") conDel.delete(tabControl1.SelectedTab.Text, pole, Convert.ToString(dataGridView2.Rows[dataGridView2.CurrentRow.Index].Cells[0].Value)); else conDel.delete(tabControl1.SelectedTab.Text, pole, Convert.ToString(dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells[0].Value)); dataGridView1.DataSource = connection.FillDGV("[Код посещаемость],[Дата урока],[Присутствие]", "Посещаемость", "[Код ученик] = " + ID_s); dataGridView2.DataSource = connection.FillDGV("[Код успеваемость],[Предмет],[Дата],[Оценка]", "Успеваемость", "[Код ученик] = " + ID_s); }