private SchoolDataSet.PersonRow GetSelectedRow()
        {
            int SelectedPersonID = Convert.ToInt32(dataGridView1.CurrentRow.Cells["PersonID"].Value.ToString());

            SchoolDataSet.PersonRow SelectedRow =
                schoolDataSet1.Person.FindByPersonID(SelectedPersonID);
            return(SelectedRow);
        }
 private void AddRowButton_Click(object sender, EventArgs e)
 {
     SchoolDataSet.PersonRow NewRow = (SchoolDataSet.PersonRow)schoolDataSet1.Person.NewRow();
     NewRow.LastName  = textBox1.Text.ToString();
     NewRow.FirstName = textBox2.Text.ToString();
     //NewRow.PersonID = Convert.ToInt32(textBox3.Text);
     NewRow.HireDate       = Convert.ToDateTime(textBox4.Text);
     NewRow.EnrollmentDate = Convert.ToDateTime(textBox5.Text);
     try
     {
         schoolDataSet1.Person.Rows.Add(NewRow);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Add Row Failed");
     }
 }