private void Button_Create(object sender, RoutedEventArgs e) { var student = new Student() { FirstName = TxtFirstName.Text, LastName = TxtLastName.Text, Major = TxtMajor.Text }; try { _bll.Create(student); DtgStudents.ItemsSource = _bll.GetAll(); } catch (Exception exception) { MessageBox.Show($"Could not create the student. {exception.Message}"); } }