Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > HDR in Jet conn string

Reply
Thread Tools

HDR in Jet conn string

 
 
=?Utf-8?B?U29sZWwgU29mdHdhcmU=?=
Guest
Posts: n/a
 
      07-23-2004
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!
 
Reply With Quote
 
 
 
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      07-24-2004
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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0xffc Thread 0x228 DBC 0x437b94 Jet'. ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr bazzer ASP .Net 0 03-30-2006 03:16 PM
ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x8fc Thread 0x934 DBC 0x437b94 Jet'. ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr bazzer ASP .Net 1 03-24-2006 04:20 PM
ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x8fc Thread 0x934 DBC 0x437b94 Jet'. ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr bazzer ASP .Net 0 03-24-2006 02:22 PM
Conn.Close & Conn.Dispose Simon Harris ASP .Net 6 06-01-2005 01:01 PM
FWSM "timeout conn" setting - Applies to inbound conn.s? dmcknigh@comcast.net Cisco 0 02-09-2005 10:47 PM



Advertisments