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