private void createButton_Click(object sender, EventArgs e) { dataset.QuestionSets.AddQuestionSetsRow(nameTextBox.Text, descriptionTextBox.Text, 0, 0, 0, 0, 0, 0, 0); if (timeTextBox.Text != "") { dataset.QuestionSets[0].TimeLimit = Convert.ToInt32(timeTextBox.Text); } else { dataset.QuestionSets[0].SetTimeLimitNull(); } if (typeComboBox.SelectedIndex != 0) { dataset.QuestionSets[0].QuestionTypeId = dataset.QuestionTypes[typeComboBox.SelectedIndex - 1].Id; } else { dataset.QuestionSets[0].SetQuestionTypeIdNull(); } if (subTypecomboBox.SelectedIndex != 0) { dataset.QuestionSets[0].QuestionSubtypeId = dataset.QuestionSubtypes[subTypecomboBox.SelectedIndex - 1].Id; } else { dataset.QuestionSets[0].SetQuestionSubtypeIdNull(); } provider.AddNewQuestionSet(dataset.QuestionSets[0]); ((Connection)connectionComboBox.SelectedItem).Refresh(); DialogResult = DialogResult.OK; }