none
unable to get the header values of an excel sheet in vb.net while using dataset.. need some help RRS feed

  • Question

  • Hi Friends,

    I am new to vb.net.  i have a requirement to read through an excel sheet with header. I am establishing an (excel) oledb connection and pushing its contents to a dataset so that i can loop through, and get the values. But i do not know where i am missing. I am able to get only the data of the excel sheet.. but not the header values.. (i.e.the first row of the excel sheet.)

    can anyone tell me how do we get the header values too.. using dataset n datatable.

    I pay my apology if it is a very silly question.. but i am badly in need of it.

    Saturday, April 24, 2010 9:36 AM

Answers

  • Did you specify in your connection string that you do not have header using HDR=No property? If you set HDR to No, then first row inside of Excel spreadsheet will be treated as a regular data row
    Val Mazur (MVP) http://www.xporttools.net
    Tuesday, April 27, 2010 12:09 PM
    Moderator

All replies

  • Did you specify in your connection string that you do not have header using HDR=No property? If you set HDR to No, then first row inside of Excel spreadsheet will be treated as a regular data row
    Val Mazur (MVP) http://www.xporttools.net
    Tuesday, April 27, 2010 12:09 PM
    Moderator
  • Hi Mazur, Thanks for the reply.. the idea worked..
    Friday, April 30, 2010 7:00 PM