none
Import Excel from 3rd Row without formatting RRS feed

  • Question

  • Hi All,

    I want to import data from excel file. My sample excel data is below.

    Let me explain first with the above image. My importing excel file has three kind of regions like,

    first row contains TableName and date.

    Second row contains ColumnNames

    From third row I have my data which needs to be import.

    I can able to read excel file with or without header. But here my problem is I need to split the first two rows(tablename and columnnames) and then read the cells from third row based on the columns to dave it int database.

    How can I achieve this? Is there any logic to read data as row by row?

    Regards,

    Sarav


    Regards, Sarav Raj!

    Saturday, September 1, 2012 12:28 PM

Answers

All replies

  • Hello,

    I would suggest explaining how you are working with Excel, for instance writing VBA code in Excel code modules or perhaps in a Visual Studio project. The more details (i.e. where do you want the extracted data to be placed into, another sheet etc.) in plain English will allow others here to assist you.


    KSG

    Sunday, September 2, 2012 7:09 AM
  • You could use OledbDataReader class to read rows one-by-one and then decide what to do with those rows. There is no provider option to skip number of rows


    Val Mazur Microsoft MVP
    http://www.xporttools.net


    Tuesday, September 4, 2012 7:56 PM
    Moderator