private void addToolStripMenuItem_Click(object sender, EventArgs e) { var add = new ClassAdder(); add.ShowDialog(); classTableAdapter.Fill(schoolDataSet.Class); schoolDataSet.AcceptChanges(); }
private void updateToolStripMenuItem1_Click(object sender, EventArgs e) { var cl = new SchoolDataSet.ClassDataTable(); classTableAdapter.FillBy(cl, Convert.ToInt32(dataGridView1.SelectedRows[0].Cells[0].Value)); object[] row = cl.Rows[0].ItemArray; var edit = new ClassAdder(Convert.ToInt32(row[0]), Convert.ToChar(row[1]), Convert.ToDateTime(row[2])); edit.ShowDialog(); classTableAdapter.Fill(schoolDataSet.Class); schoolDataSet.AcceptChanges(); }