title: Re-open SqlDataReader
body: <p>My code throws the error</p>
  
  <blockquote>
    <p>Invalid attempt to call Read when reader is closed.</p>
  </blockquote>
  
  <p>I'm using SqlDataReader to read values from database, and that is my code:</p>
  
  <pre><code>while (rd.Read())
  {
      string stateincharge = rd["stateincharge"].ToString();
      string email = rd["email"].ToString();
      cmd.Dispose();
      rd.Close();
      cmd = con.CreateCommand();
      cmd.CommandText = "str_procedure";
      cmd.Parameters.AddWithValue("@stateincharge", stateincharge);
      cmd.CommandType = CommandType.StoredProcedure;
      ad.SelectCommand = cmd;
      ad.Fill(ds);
      count = ds.Tables[0].Rows.Count;
      DataTable dt = new DataTable();
  }
  </code></pre>
  
  <p>This runs in a loop in ASP.NET code-behind. </p>
  
  <p>My problem is that I think I need to close SqlDatReader because of an error shown.</p>
  
  <p>How can I again open sqlDataReader at end of the while loop?</p>