using (ExcelPackage xlPackage = new ExcelPackage(existingFile))
DataTable dt; string XmlString = string.Empty; string strFile = ExcelFileUpload.FileName; var fileExt = System.IO.Path.GetExtension(ExcelFileUpload.FileName); if (fileExt == ".xlsx" || fileExt == ".xls") { ExcelFileUpload.SaveAs("C:\\Docs\\" + strFile); FileInfo existingFile = new FileInfo("C:\\Docs\\" + strFile); using (ExcelPackage xlPackage = new ExcelPackage(existingFile)) ***//throws Exception*** { ExcelWorksheet worksheet = xlPackage.Workbook.Worksheets[1]; dt = new DataTable(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)