private void button3_Click(object sender, EventArgs e) { Advisos a = new Advisos(); this.Hide(); a.Show(); }
private void delstu_Click(object sender, EventArgs e) { if (dataGridstudent.SelectedCells.Count != 0) { int rw = dataGridstudent.SelectedCells[0].RowIndex; String cmd = String.Format("Delete from ProjectAdvisor Where(ProjectId = (Select Id from Project Where Title = '{0}'))", dataGridstudent.Rows[rw].Cells["Title"].Value.ToString()); SqlCommand del = new SqlCommand(cmd, DatabaseConnection.getInstance().getConnection()); int count = del.ExecuteNonQuery(); Advisos p = new Advisos(); this.Hide(); p.Show(); } }