public static string[] GetNames() { DataTable dTable = null; string[] objNamesList = null; dTable = AppointmentDAL.GetNames(); if (dTable.Rows.Count > 0) { objNamesList = dTable.AsEnumerable().Select(row => row.Field <string>("NAME")).ToArray(); } return(objNamesList); }