Hari B

Hari B

  • NA
  • 139
  • 67.6k

Excel reading

Nov 3 2015 8:33 AM
Hello All,
 
Here i am using EPPlus dll and read the excel.
 
below my code:
 
 
public JsonResult UpdateFHSerialNumber(string strExcelPath)
{
    try
   {
         string cell = string.Empty;         
         Stream str = strExcelPath;
         //FileInfo file = new FileInfo(Request.Files["file_Rel_FH_SrNum_Name"].FileName);
         using (ExcelPackage excelPkg = new ExcelPackage())
            {
                     ExcelWorksheet oSheet = excelPkg.Workbook.Worksheets[1];
                     cell = oSheet.Cells[4, 3].Value.ToString();
            }
return Json{ error = read sucessfully});
}
 
in above code i comment fileinfo it's working in local system not working in server.
 
if working with action results it's working. but i need JsonResult so suffering with path
 
 
if i am using action results
 
public ActionResult Index(HttpPostedFileBase file)
 
i get excel file and read easy but i am using Jsonresult i get only path how can i read excel file using path
 
 
 

Answers (1)