excelReader.AsDataSet() does not exist in silverlight

May 17, 2013 at 3:07 PM
Hello,

I am trying to do the home page example but the AsDataSet() does not exist for me in the following two lines.

IExcelDataReader excelReader = ExcelReaderFactory.CreateOpenXmlReader(e.Result);
DataSet result = excelReader.AsDataSet();

excelreader has several other functions but not the one i need to be able to read the stream.

Thanks
Developer
May 22, 2013 at 8:28 AM
Edited May 22, 2013 at 8:28 AM
That is a bit strange as it is a member of that interface. I am not familiar with silverlight development however.
May 29, 2013 at 10:57 AM
In Silverlight you could use the IWorkBook Interface instead:
IExcelDataReader excelReader = ...;
...
IWorkBook workBook = excelReader.AsWorkBook();

foreach (IWorkSheet workSheetFromExcel in workBook.WorkSheets)
{
       ...workSheetFromExcel.Rows
}