Пример #1
0
        public StuItem maxGPA()
        {
            string sql = "SELECT * FROM STUDENT WHERE STU_GPA = (SELECT MAX(STU_GPA) FROM STUDENT) ; ";

            using (MySqlConnection connection = new MySqlConnection(DBpath))
            {
                StuItem maxStudent = connection.QuerySingle <StuItem>(sql);
                return(maxStudent);
            }
        }
Пример #2
0
        public StuItem findId(string id)
        {
            string sql = "SELECT * FROM STUDENT WHERE STU_ID = @ID;";

            using (var connection = new MySqlConnection(DBpath))
            {
                StuItem student = connection.QuerySingle <StuItem>(sql, new { ID = id });
                return(student);
            }
        }