[ACCEPTED]-Read Excel File Data From HttpPostedFileBase object-excel
Accepted answer
If you use EPPlus, it's as simple as this:
public void ImportExcelXls(HttpPostedFileBase fileBase)
{
using (var package = new ExcelPackage(fileBase.InputStream))
{
// get the first worksheet in the workbook
ExcelWorksheet worksheet = package.Workbook.Worksheets[1];
int col = 1;
for (int row = 1; worksheet.Cells[row, col].Value != null; row++)
{
// do something with worksheet.Cells[row, col].Value
}
} // the using
}
0
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.