HDR in Jet conn string

Discussion in 'ASP .Net' started by =?Utf-8?B?U29sZWwgU29mdHdhcmU=?=, Jul 23, 2004.

  1. Hello,

    I building an automatic parser in .NET that opens an XLS using OLEDB's Jet driver. In the connection string it allows you to add "HDR=Yes" as an extended property if the first line has the column titles instead of the data (so the OLEDB will skip the first line). This is a great option, but how does one determine whether the first line should be skipped or not at run time? With a CSV file it is possible to just open the file as text, read the first line, and look at it (i.e. to find if it contains "Zip Code" and "Phone") to determine whether to tell OLEDB to skip it. But this doesn't work with XLS. Any suggestions would be appreciated!
    =?Utf-8?B?U29sZWwgU29mdHdhcmU=?=, Jul 23, 2004
    #1
    1. Advertising

  2. Hi,

    As for the checking whether the xls sheet contains a titile line problem.
    It seems that currently we haven't any good means to check it before we
    load the data into our data collection. As you have mentioned that the xls'
    file has its particular format which is hard to parse through it.
    However, since in .net, we can use OLEDB provider to connect a xls file and
    retireve the data into DATASETvia DataAdapter, I think we can do the
    checking after the loading the data into dataset. Then, we if it contains
    the title row, we can set the columns' name property according to the title
    row and remove this datarow. Do you think so?
    Also, if you have any other ideas ,please also feel free to post here.
    thanks.

    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)

    Get Preview at ASP.NET whidbey
    http://msdn.microsoft.com/asp.net/whidbey/default.aspx
    Steven Cheng[MSFT], Jul 24, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ante Perkovic

    Re: reading sqldatareader after conn.close()

    Ante Perkovic, Jul 2, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    415
    Ante Perkovic
    Jul 2, 2003
  2. Simon Harris

    Conn.Close & Conn.Dispose

    Simon Harris, May 31, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    5,965
    Karl Seguin
    Jun 1, 2005
  3. Ranginald
    Replies:
    5
    Views:
    437
    Nobody
    Nov 25, 2006
  4. bpowah

    HDR and PIL

    bpowah, Sep 9, 2007, in forum: Python
    Replies:
    0
    Views:
    348
    bpowah
    Sep 9, 2007
  5. Replies:
    2
    Views:
    121
    Dominick Baier [DevelopMentor]
    Jun 10, 2006
Loading...

Share This Page