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; }
and button:
private void btnAdminStudentView_Click(object sender, EventArgs e) { DataSet ds = studentHelperClass.selectStudent(); dataGridStudent.DataSource = ds.Tables["studentInfo"]; }
why would it give me a result similar to this when a button is clicked?
source share