protected void btnSubmit_Click(object sender, EventArgs e) { // Dropdown Value... int QType = Convert.ToInt32(drpType.SelectedValue); int Course = Convert.ToInt32(drpCourse.SelectedValue); // Add Question... _survey.QuestionType = QType; _survey.QuestionText = txtQuestion.Text.Trim(); _survey.Course = Course; Int64 QId = _survey.AddQuestion(); // Add Options... string[] option = txtOptions.Text.Split(','); int optionlength = option.Length; for (int i = 0; i < optionlength; i++) { string opt = option[i].ToString().Trim(); if (opt != "") { _survey.QuestionID = QId; _survey.Option = opt; _survey.AddOption(); } } }