conn.Open();
//ssql = "select last_name, first_name, middle_name, grade, section, subject, grading, quiz_title, quiz_type, no_of_items, sum(score) as 'score' from student_quiz t1 inner join account t2 on t1.student_id = t2.id inner join quizzes t3 on t1.quiz_id = t3.quiz_id inner join quiz_tions t4 on t1.quiz_id = t4.quiz_id inner join scores t5 on t4.quiz_id = t5.quiz_id and t4.question_no = t5.question_no where IsCompleted = 'YES' and IsChecked = 'YES' and t1.teacher_id = '" + id2.Text + "' group by quiz_title";
MySqlDataAdapter sda = new MySqlDataAdapter("select Last_Name,First_Name,Middle_Name,Grade,Section,Subject,Grading,Quiz_Title,Quiz_Type,No_of_Items, PointsPerQuestion,concat(sum(score),' out of ',No_of_Items * PointsPerQuestion) AS score from student_quiz t1 join account t2 on t1.student_id = t2.ID join quizzes t3 on t1.quiz_id = t3.Quiz_ID join quiz_tions t4 on t1.quiz_id = t4.Quiz_ID join scores t5 on t4.Quiz_ID = t5.quiz_id and t4.Question_no = t5.question_no where t1.IsCompleted = 'YES' and t1.IsChecked = 'YES' and t1.teacher_id = '18' and t2.User_Level = 'Student' group by t3.Quiz_Title,t2.Last_Name,t2.First_Name,t2.Middle_Name,t2.Grade,t2.Section,t3.Subject,t3.Grading,t4.Quiz_Type,t3.No_of_Items", conn);
//MySqlDataAdapter sda = new MySqlDataAdapter("select last_name, first_name, middle_name, grade, section, subject, grading, quiz_title, quiz_type, no_of_items, sum(score) as 'score' from student_quiz t1 inner join account t2 on t1.student_id = t2.id inner join quizzes t3 on t1.quiz_id = t3.quiz_id inner join quiz_tions t4 on t1.quiz_id = t4.quiz_id inner join scores t5 on t4.quiz_id = t5.quiz_id and t4.question_no = t5.question_no where IsCompleted = 'YES' and IsChecked = 'YES' and t1.teacher_id = '" + id2.Text + "' group by quiz_title", conn);
DataTable data = new DataTable();
sda.Fill(data);
pdata1.DataSource = data;
这是我的代码,它获取要显示在datagridview中的值,但是我收到此错误:error pic
但是当我在phpmyadmin上尝试查询时没关系,这是输出:output pic
我该如何解决这个错误?请帮忙