Can't read excel file

Topics: Developer Forum, User Forum
Nov 13, 2013 at 9:30 PM
I am trying to read excel file however it's not working, Here's the code

using System;
using System.IO;
using ICSharpCode;
using Excel;

namespace datamining2
{
class MainClass
{
    public static void Main (string[] args)
    {
        string filePath = "/home/khaled/Documents/datamining.xls";
        FileStream stream = File.Open(filePath, FileMode.Open, FileAccess.Read);
        IExcelDataReader excelReader = ExcelReaderFactory.CreateBinaryReader(stream);

        while (excelReader.Read())
    {
            //Console.WriteLine(excelReader);
        excelReader.GetInt32(0);
    }
        excelReader.Close();

    }
}
}
Jul 7, 2014 at 11:04 PM
Use ".xlsx" extension instead of ".xls" in your file path.

And I want to ask the developers, how can save the file in xls format? Is it even possible?