title: Getting an error with data reader
body: <p>am trying to get data from sql database using the datareader to put them in a combobox but am getting error in this code says :Invalid attempt to call Read when reader is closed.
  the error is in the second part of the code in the while sentence. its a code for a form load.</p>
  
  <pre><code>class DataLoad
  {  
      public SqlDataReader comboboxLoad()
      {
          SqlConnection con = new SqlConnection("Data Source=Abdullah-PC;Initial Catalog=SmartPharmacyDB;Integrated Security=True");
          SqlCommand com = new SqlCommand();
          com.Connection = con;
          SqlDataReader dr;
          com.CommandText = "select drugname from drugtab order by drugname";
          con.Open();
          dr = com.ExecuteReader();
          con.Close();
          return dr;
      }
  }
  
  
  
  private void Smart_Pharmacy_Load(object sender, EventArgs e)
      {
          DataLoad d = new DataLoad();
          SqlDataReader DR = d.comboboxLoad();
  
          while (DR.Read())
          {          
              DrugNameCombo.Items.Add(DR["drugname"]);
          }
      }
  </code></pre>