Ejemplo n.º 1
0
    public List<Quiz_Comprehension> GetMockTest_Comprehension(string studentID, int courseID, int subjectID, int chapterID, int count)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand command = new SqlCommand("GetMockTest_Comprehension", connection);
            command.CommandType = CommandType.StoredProcedure;
            command.Parameters.Add("@StudentID", SqlDbType.NVarChar).Value = studentID;
            command.Parameters.Add("@CourseID", SqlDbType.Int).Value = courseID;
            command.Parameters.Add("@SubjectID", SqlDbType.Int).Value = subjectID;
            command.Parameters.Add("@ChapterID", SqlDbType.Int).Value = chapterID;
            command.Parameters.Add("@Count", SqlDbType.Int).Value = count;
            connection.Open();
            IDataReader reader = command.ExecuteReader();

            SqlQuiz_ComprehensionProvider comprehensionProvider = new SqlQuiz_ComprehensionProvider();
            return comprehensionProvider.GetQuiz_ComprehensionsFromReader(reader);
        }
    }