title: How to read multiple resultset from SqlDataReader?
body: <p>I have a SP from that I am trying to return 2 result set from, and in my .cs file i am trying something like this:</p>
  
  <pre><code>dr = cmd.ExecuteReader();
  while (dr.Read())
  {
    RegistrationDetails regDetails = new RegistrationDetails()
    {
      FName = dr["FName"].ToString(),
      LName = dr["LName"].ToString(),
      MName = dr["MName"].ToString(),
      EntityName = dr["EntityName"].ToString(),// in 2nd result set
      Percentage = dr["Percentage"].ToString()// in 2nd result set
     };
  }
  </code></pre>
  
  <p>However I am getting an :</p>
  
  <blockquote>
    <p>error:IndexOutOfRange {"EntityName"}</p>
  </blockquote>