waleskim / linqtoexcel

Automatically exported from code.google.com/p/linqtoexcel
0 stars 0 forks source link

Unable to get any data from Excel #7

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi 
I am unable to get any data from Excel 2003 file.
please see the attached file.
I wolud expecting all country name , Code and Name.
I am using folliowing code

IExcelRepository<ExcelData> getExcelData= new ExcelRepository<ExcelData>
(@"C:\Book1.xls");
var bookData = from c in getExcelData.Worksheet()
               select c;
 public class ExcelData
    {
        public string countryName { get; set; }
        public int Code { get; set; }
        public string Name { get; set; }
    }

Original issue reported on code.google.com by REGISTER...@gmail.com on 29 Sep 2009 at 12:48

Attachments:

GoogleCodeExporter commented 9 years ago
The problem is in the Excel worksheet. The header row needs to be on the first 
row. 
(It was on the 3rd row in the worksheet you provided). Another issue was with 
the 
countryName column. countryName was not in the heading row, and the countries 
(Australia and New Zealand) were not in each row.

I attached an updated worksheet that shows the correct formatting.

Original comment by paulyo...@gmail.com on 29 Sep 2009 at 4:12

Attachments: