title: Using MySQL Data Reader
body: <p>I'm not familiar with using Data Reader, i need help with the following code, i want to retrieve a single data from the database.</p>
  
  <pre><code>MySqlDataAdapter data = new MySqlDataAdapter(cmd);
                      conn.Open();
                      DataTable dt = new DataTable();
                      data.Fill(dt);
                      gridView1.DataSource = dt;
  
                      int retrievedValue = 0;
                      using (MySqlDataReader reader = cmd.ExecuteReader())
                      {
                          while (reader.Read())
                          {
                              if ((int)reader["order_status"] == 0)
                              {
                                  retrievedValue = (int)reader.GetValue(0);
  
                                      GridView View2 = sender as GridView;
                                      e.Appearance.BackColor = Color.Green;
                                      e.Appearance.BackColor2 = Color.ForestGreen;
                              }
                          }
                      }
  </code></pre>