I have a workbook with the same problem:
private void Test()
{
using (FileStream streamIn = File.Open(@"Z:\SIW\Pass1 Data\dms_vendor.extract.xlsx", FileMode.Open, FileAccess.Read))
using (IExcelDataReader execlReader = ExcelReaderFactory.CreateOpenXmlReader(streamIn))
{
int r = execlReader.ResultsCount;
int x = r;
DataSet dataset = execlReader.AsDataSet();
foreach (DataTable sheet in dataset.Tables)
{
var a = sheet;
var b = a;
}
}
}
When I break at the foreach and view the dataset it says the Tables count is 0 although the xlsx file has 260 lines and columns out to AC.
Comments: ** Comment from web user: balasu **
private void Test()
{
using (FileStream streamIn = File.Open(@"Z:\SIW\Pass1 Data\dms_vendor.extract.xlsx", FileMode.Open, FileAccess.Read))
using (IExcelDataReader execlReader = ExcelReaderFactory.CreateOpenXmlReader(streamIn))
{
int r = execlReader.ResultsCount;
int x = r;
DataSet dataset = execlReader.AsDataSet();
foreach (DataTable sheet in dataset.Tables)
{
var a = sheet;
var b = a;
}
}
}
When I break at the foreach and view the dataset it says the Tables count is 0 although the xlsx file has 260 lines and columns out to AC.
Comments: ** Comment from web user: balasu **
Some rows returns blank values. It works when i caopy the rows to a notepad and paste it back to the excel.[0A]