4
public static DataSet selectStudent()
{
MySqlConnection conn = connection();
conn.Open();
MySqlCommand cmd = new MySqlCommand();
cmd.Connection = conn;
MySqlDataAdapter adap = new MySqlDataAdapter(@"SELECT person.*, student.gradePointAverage, student.majorField FROM person JOIN student", conn);
MySqlCommandBuilder sqlCmd = new MySqlCommandBuilder(adap);
DataSet sqlSet = new DataSet();
adap.Fill (sqlSet, "studentInfo");
conn.Close();
return sqlSet;
}
private void btnAdminStudentView_Click(object sender, EventArgs e)
{
DataSet ds = studentHelperClass.selectStudent();
dataGridStudent.DataSource = ds.Tables["studentInfo"];
}
为什么会变成这样给我这样的按钮,结果点击?因为你没有定义的记录如何相互关联
可能是因为连接条件(或缺乏) – Ric