private void Retrive_StudentLRN_Section_GradeLevel() { try { string RetrieveQuery = "SELECT [LRN], [GRADE LEVEL], [SECTION] FROM [Tbl.Students] WHERE [STUDENT ID] = '" + StudentID + "'"; sqlcommand = new SqlCommand(RetrieveQuery, sqlconnection); SqlDataReader sqldatareader = sqlcommand.ExecuteReader(); while (sqldatareader.Read()) { LRNTextbox.Text = sqldatareader.GetString(0); GradeLevelDropdown.AddItem(sqldatareader.GetString(1).ToUpper()); SectionDropdown.AddItem(sqldatareader.GetString(2).ToUpper()); } sqldatareader.Close(); GradeLevelDropdown.selectedIndex = 0; SectionDropdown.selectedIndex = 0; } catch (Exception) { //DON'T DISPLAY ANYTHING SHIT ! } }
private void Load_Personal_Info_AsPlaceholder() { try { string RetrieveQuery = "SELECT * FROM [Tbl.Students] WHERE [STUDENT ID] = '" + StudentID + "'"; sqlcommand = new SqlCommand(RetrieveQuery, sqlconnection); SqlDataReader sqldatareader = sqlcommand.ExecuteReader(); while (sqldatareader.Read()) { StudentIDTextbox.Text = sqldatareader.GetString(0); UserIDTextbox.Text = sqldatareader.GetString(1); LRNTextbox.Text = sqldatareader.GetString(2); FirstNameTextbox.Text = sqldatareader.GetString(3); MiddleNameTextbox.Text = sqldatareader.GetString(4); LastNameTextbox.Text = sqldatareader.GetString(5); GradeLevelDropdown.Clear(); GradeLevelDropdown.AddItem(sqldatareader.GetString(6)); GradeLevelDropdown.selectedIndex = 0; SectionDropdown.Clear(); SectionDropdown.AddItem(sqldatareader.GetString(7)); SectionDropdown.selectedIndex = 0; Gender = sqldatareader.GetString(8); if (Gender.Equals("Male")) { GenderDropdown.selectedIndex = 0; } else { GenderDropdown.selectedIndex = 1; } BirthDate = string.Format("{0:d}", sqldatareader.GetString(9)); BirthDatepicker.Value = DateTime.Parse(BirthDate); PresentAddressTextbox.Text = sqldatareader.GetString(10); PlaceOfBirthTextbox.Text = sqldatareader.GetString(11); BloodTypeTextbox.Text = sqldatareader.GetString(12); ReligionTextbox.Text = sqldatareader.GetString(13); IndiginousGroupTextbox.Text = sqldatareader.GetString(14); EmailAddressTextbox.Text = sqldatareader.GetString(15); MobileNumberTextbox.Text = sqldatareader.GetString(16); } sqldatareader.Close(); } catch (Exception) { //DON'T DO ANYTHING SHIT ! } }
private void RetrieveSectionList() { sqlquery5 = "SELECT TOP 10 [SECTION NAME] FROM [Tbl.Sections] WHERE [SCHOOL YEAR] = '" + CurrentSchoolYear + "'"; sqlcommand = new SqlCommand(sqlquery5, sqlconnection); SqlDataReader sqldatareader = sqlcommand.ExecuteReader(); while (sqldatareader.Read()) { SectionDropdown.AddItem(sqldatareader.GetString(0)); } sqldatareader.Close(); SectionDropdown.selectedIndex = 0; }
private void Retrieve_Section_List() { try { string RetrieveQuery = "SELECT TOP 10 [SECTION NAME] FROM [Tbl.Sections] WHERE [SCHOOL YEAR] = '" + CurrentSchoolYear + "'"; sqlcommand = new SqlCommand(RetrieveQuery, sqlconnection); SqlDataReader sqldatareader = sqlcommand.ExecuteReader(); while (sqldatareader.Read()) { SectionDropdown.AddItem(sqldatareader.GetString(0)); } sqldatareader.Close(); SectionDropdown.selectedIndex = 0; } catch (Exception) { //DO NOTHING BITCH ! } }
private void Retrieve_Section_List() { try { string localvariablestring = "SELECT * FROM [Tbl.AssignedSections] WHERE [TEACHER ID] = '" + TeacherID + "'"; sqlcommand = new SqlCommand(localvariablestring, sqlconnection); SqlDataReader sqldatareader = sqlcommand.ExecuteReader(); SectionDropdown.Clear(); while (sqldatareader.Read()) { int index = 2; for (int iterator = 0; iterator < 10; iterator++) { SectionDropdown.AddItem(sqldatareader.GetString(index)); index++; } } SectionDropdown.selectedIndex = 0; sqldatareader.Close(); try { RemoveSpaceInSections(); } catch (Exception) { //DO NOTHING BITCH ! } } catch (Exception) { //DO NOTHING BITCH ! } }