I have the following piece of code getting values from a Listbox. I've three teachers selected. when 'i' value reaches 3 it shows'Index was outside the bounds of array' error
string selectedTeachers = Request["SelectedTeachersList"];
int[] teachers_ID = Array.ConvertAll(selectedTeachers.Split(','), int.Parse);
for (int i = 0; i <= teachers_ID.Length; i++)
{
int Id = teachers_ID[i];
}