How to read selected column data in a specific excel sheet.

Sep 24, 2012 at 10:48 AM

Hi All,

How could i read selected column data in a specific excel sheet.

 

Thanks. 

Apr 8, 2013 at 2:54 PM
Try using DataSet, something like
using(IExcelDataReader excelReader = ExcelReaderFactory.CreateBinaryReader(stream)) {
    DataSet result = excelReader.AsDataSet(); // populate to result
    var dt = ds.Tables["FooTable"];
    foreach (DataRow dr in dt.Rows)
    {
       var magicalPonyData = dr["Column1"].ToString();
        // do something with your magical data
    }
}