public string GetStudentAchievementByDate(string id) { string result; StudentAnalysisByDates analysis = new StudentAnalysisByDates(); result = analysis.AnalysisScores(id); return(result); }
internal void GetStudentScoreByDates(int snum, StudentAnalysisByDates analysis) { string sql = "select TOP 10 AVG(학생점수) AS 평균, 문제푼시간 AS 날짜 from stuscore where stuscore.학생번호 = " + snum.ToString() + " group by 문제푼시간 order by 문제푼시간 DESC"; using (SqlCommand scom = new SqlCommand(sql, scon)) { scom.Connection.Open(); using (SqlDataReader reader = scom.ExecuteReader()) { if (reader == null) { scom.Connection.Close(); return; } while (reader.Read()) { analysis.StudentScores.Add(new StudentAnalysisByDates.StudentScore(reader["날짜"].ToString(), (int)reader["평균"])); } scom.Connection.Close(); analysis.StudentScores.Reverse(); } } }