private void getStudentInformation()
{
SqlConnection conOOC = new SqlConnection(ConfigurationManager.ConnectionStrings["OlympiaOpenCollegeDatabaseConnection"].ConnectionString);
SqlCommand cmdSelectStudent = new SqlCommand("SELECT l.LearnerID, l.Name, l.Email FROM Learner l, Registration r WHERE l.LearnerID = r.LearnerID AND r.RegistrationID = @registerID" , conOOC);
SqlDataReader dtrStudent;
conOOC.Open();
cmdSelectStudent.Parameters.AddWithValue("@registerID", "R001");
dtrStudent = cmdSelectStudent.ExecuteReader();
while (dtrStudent.Read())
{
lblStudentID.Text = dtrStudent["l.LearnerID"].ToString();[Note: Error Occured]
lblStudentName.Text = dtrStudent["l.Name"].ToString();
lblEmail.Text = dtrStudent["l.Email"].ToString();
}
conOOC.Close();
}
IndexOutOfRangeException was unhandled by user code
What's is the problem? :/