none
OleDbDataAdapter skips the LAST row in an Excel worksheet RRS feed

  • Question

  • Hi! OleDbDataAdapter skips the LAST row in an Excel worksheet .  If I open the file outside of my C# program and then run the program, it brings all rows.  If I open, save, then close the file, it brings all rows.  Does anyone have any idea why it skips the last row?
    • Moved by Chris Robinson- MSFT Wednesday, July 29, 2009 7:51 PM Provider related question (From:ADO.NET DataSet)
    Wednesday, July 29, 2009 7:25 PM

Answers

  • Do you know if file was generated by Excel or by some third-party component? From my experience I had similar issues when file is generated by third-party tool, but format of it does not conform to the Excel specification. When you resave the file, Excel application usually fixes fomat issues and then Jet provider reads it fine. That's is my guess and does not mean that you experience exact same issue.
    Val Mazur (MVP) http://www.xporttools.net
    Wednesday, July 29, 2009 9:12 PM
    Moderator

All replies

  • Do you know if file was generated by Excel or by some third-party component? From my experience I had similar issues when file is generated by third-party tool, but format of it does not conform to the Excel specification. When you resave the file, Excel application usually fixes fomat issues and then Jet provider reads it fine. That's is my guess and does not mean that you experience exact same issue.
    Val Mazur (MVP) http://www.xporttools.net
    Wednesday, July 29, 2009 9:12 PM
    Moderator
  • Thank you, Val.  Resave does help.
    Thursday, July 30, 2009 4:02 PM