public static void getAllDepts() { List <Object> olist2 = RequisitionDAO.getAllDepInvolved(); foreach (Object o in olist2) { Console.WriteLine(o.ToString().Substring(12, 4)); depList.Add(o.ToString().Substring(12, 4)); } }