title: SqlDataReader help for displaying the data that is read into the text of different labels C#
body: <p>I am not very confident with the capabilities of <code>SqlDataReader</code> and how it works, would it be possible for me to create something that for each <code>StudentID</code> found corresponding to the SQL query, it displays every ID in a different label? And if so could you please help me out in how I would achieve this.</p>
  
  <p>This is my code that I have so far with the SQL query:</p>
  
  <pre><code>private void SetTestsForm_Load(object sender, EventArgs e)
  {
      string y = GlobalVariableClass.Signedinteacher;
  
      string connectionString = ConfigurationManager.ConnectionStrings["myconnectionstring"].ConnectionString;
      SqlConnection connect = new SqlConnection(connectionString);
      connect.Open();
  
      SqlCommand command20 = new SqlCommand(@"SELECT [StudentID] FROM StudentDetails WHERE ([TeacherID] = @signedinteacher)", connect);
  
      command20.Parameters.AddWithValue("@signedinteacher", y);
  
      SqlDataReader reader = command20.ExecuteReader(); 
  }
  </code></pre>