I am currently evaluating Aspose.Cells 4.1.2. Is it possible to ImportFromDataReader from an IDataReader? It appears that ImportFromDataReader requires either a SQLDataReader or OleDBDataReader. I attempted to cast IDataReader to SqlDataReader (like what I saw on a previous Aspose.Cells forum post) but I am receiving an invalid cast error.
Workbook workbook = new Workbook();
Worksheet sheet = workbook.Worksheets[0];Database db = DatabaseFactory.CreateDatabase(System.Configuration.ConfigurationSettings.AppSettings["DatabaseName"].ToString());
using (IDataReader dr = db.ExecuteReader("PKG_REPORTING_TOO.GetComprehensive", "Null", Session["SQLCriteria"].ToString(), Session["RecordType"]))
{
sheet.Cells.ImportFromDataReader((SqlDataReader)dr,1,0,true);
}
We are currently using Microsoft Enterprise Library...thus the IDataReader. I guess I could build a data reader without using Enterprise Library but would prefer to avoid it if possible.
Thanks for any assistance.