2

This is my code

    var data = new LinqToExcel.ExcelQueryFactory();
                data.FileName = @"FRM_DTA.xlsx";                
                var result = from x in data.Worksheet<ExcelFileDefinition>()
                             select x;
Console.WriteLine(result.Count());

I got this exception:

OleDbException was unhandled

IErrorInfo.GetDescription failed with E_FAIL(0x80004005).

on the console.write statement.

when I remove the console .write line, I got no exception

Anastasie Laurent
  • 877
  • 2
  • 14
  • 26

1 Answers1

4

The problem was the file name being incorrect. Changing that solved the problem.

Patrick Hofman
  • 153,850
  • 22
  • 249
  • 325
Anastasie Laurent
  • 877
  • 2
  • 14
  • 26