public static InstructorCollection GetCollection() { InstructorCollection tempList = null; using (SqlConnection myConnection = new SqlConnection(AppConfiguration.ConnectionString)) { using (SqlCommand myCommand = new SqlCommand("usp_GetInstructor", myConnection)) { myCommand.CommandType = CommandType.StoredProcedure; myCommand.Parameters.AddWithValue("@QueryId", SelectTypeEnum.GetCollection); myConnection.Open(); using (SqlDataReader myReader = myCommand.ExecuteReader()) { if (myReader.HasRows) { tempList = new InstructorCollection(); while (myReader.Read()) { tempList.Add(FillDataRecord(myReader)); } } myReader.Close(); } } } return(tempList); }
private void BindInstructorList() { InstructorCollection instructorList = InstructorManager.GetCollection(); rptInstructorList.DataSource = instructorList; rptInstructorList.DataBind(); }
private void BindInstructorList() { InstructorCollection instructorList = new InstructorCollection(); instructorList = InstructorDAL.GetCollection(); rptInstructorList.DataSource = instructorList; rptInstructorList.DataBind(); }