I am using linqToExcel dll from to read a csv file and query the csv file the data . I also neeed the names of columns (Header ) from csv .
when i try to run the following code as per the document mentioned
its throw an error message as follow :
The Microsoft Jet database engine could not find the object 'Sheet1$.txt'. Make sure the object exists and that you spell its name and the path name correctly.
my code is as follow :
string pathToExcelFile = ""
+ @"c:\users\rahul\documents\visual studio 2013\Projects\WebApplication1\WebApplication1\csv\student.csv";
string sheetName = "student";
var excelFile = new ExcelQueryFactory(pathToExcelFile);
//get all sheet names
var sheetNames = excelFile.GetWorksheetNames();
//get column name from csv
var columnNames = excelFile.GetColumnNames(sheetName);
To get the correct sheet name i tried to use excelFile.GetWorksheetNames() but its return zero records.
Note: I am using csv file and when i open same csv file in MS Excel its shows me student as Sheet Name even i tried with sheet1 as well.