I want to retrieve some specific data from tblBranches based to the choice of the user in the combobox (cboBranch.Text), one is the class_name but when I tried to run the program the messagebox shows MySql.Data.MySqlClient.MySqlDataReader, so how can I properly retrieve the data in my database?
query = "SELECT class_name FROM tblBranches WHERE branch_name=@branch";
MySqlCommand cmd = new MySqlCommand(query, con);
cmd.Parameters.Add("@branch", MySqlDbType.VarChar, 30).Value = _order.cboBranch.Text;
MySqlDataReader dr;
con.Open();
dr = cmd.ExecuteReader();
string class_name = dr.ToString();
MessageBox.Show(class_name);
con.Close();