示例#1
0
        public static List <string> GetExcelDataSheets(string fileName)
        {
            List <string> list = new List <string>();

            Excel.Import i = new Excel.Import(fileName);
            try
            {
                list.AddRange(i.GetSheetNames());
            }
            catch (Exception e)
            {
                throw e;
            }


            return(list);
        }
示例#2
0
 public static DataTable GetExcelDataFromFile(string fileName, string sheet)
 {
     Excel.Import i = new Excel.Import(fileName, sheet.Replace("'", ""));
     return(i.Query());
 }