Quantcast
Channel: Excel Data Reader - Read Excel files in .NET
Viewing all articles
Browse latest Browse all 448

Commented Issue: return null dataset, open xls file only have 1 sheet [11516]

$
0
0
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 **

Some rows returns blank values. It works when i caopy the rows to a notepad and paste it back to the excel.[0A]


Viewing all articles
Browse latest Browse all 448

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>