Trouble Reading Column Name in excel File into Dataset, C#

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sachinkale123
    New Member
    • Jul 2007
    • 37

    Trouble Reading Column Name in excel File into Dataset, C#

    Hi,
    I am reading excel file and reading values from that
    I am using provider As : "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source = " + Filename + ";Extended Properties=\"Ex cel 8.0;Hdr=No;IMEX =1\"";

    EXCEL File

    WINDOWS FILE EXEL 2003_______ 23 _______24
    File Name : abc.txt________ ______145______124
    File Data : 04/05/2009
    Sample Name: xyz
    Sample Weight: 23 gm
    Sample Description: Dry

    Time____Mass___ __dm_________Sol 1____Sol 2____Sol 3
    0.01____13.8355 ___138.355_____ _-8910_______0.55 ______24.87
    0.02____14.8355 ___144.355_____ _-3310_______0.21 ______33.87


    but After reading values into Dataset values look like

    DATASET

    WINDOWS FILE EXEL 2003_______ 23 _______24
    File Name : abc.txt________ ______145______124
    File Data : 04/05/2009
    Sample Name: xyz
    Sample Weight: 23 gm
    Sample Description: Dry

    Time____Mass___ __dm__________________________Sol 3
    0.01____13.8355 ___138.355_____ _-8910_____0.55__ ____24.87
    0.02____14.8355 ___144.355_____ _-3310_____0.21__ ____33.87
    Column Name 'Sol 1' and 'Sol 2' is missing even though it is reading the readings. Just not able to read column names.

    I am not sure about what is exact problem. so please help me in solving this.

    Thanx in advance.
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Recheck your configurations, Perhaps you mistyped something somewhere?

    Comment

    Working...