I've highlighted the things which I want to read separately, in dataTables , if possible.
I've used Following code but it only works when there is only one table is present in the sheet.
I've used Following code but it only works when there is only one table is present in the sheet.
{public DataSet ReadXlsx(string filepath)
try{FileStream stream = File.Open(filepath, FileMode.Open, FileAccess.Read);//2. Reading from a OpenXml Excel file (2007 format; *.xlsx)IExcelDataReader excelReader2 = ExcelReaderFactory.CreateOpenXmlReader(stream);//... //4. DataSet - Create column names from first rowexcelReader2.IsFirstRowAsColumnNames = true;DataSet result2 = excelReader2.AsDataSet(); return result2;}catch (Exception ex){return null;}
}
Please help. Thanks.
Vishal JadavPosted Sep 19, 2016, 10:22 AM