Using ADO.NET to connect to a CSV File, Need Help

  • Thread starter Thread starter C Newby
  • Start date Start date
C

C Newby

Using an ODBCConnection and ODBCDataAdapter object, I am able to connect to
a CSV file. However, my data tables are all comeing back with the first line
of the CSV file used as a column header line.

How do i disable this?

TIA//
 
Add headers to the file?

--
____________________________________
Bill Vaughn
MVP, hRD
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
¤ Using an ODBCConnection and ODBCDataAdapter object, I am able to connect to
¤ a CSV file. However, my data tables are all comeing back with the first line
¤ of the CSV file used as a column header line.
¤
¤ How do i disable this?

You can do it in the connection string or a schema.ini file. Connection string is easier and I would
recommend using the .NET OLEDB library with the Jet provider instead of ODBC:

Dim TextConnection As New OleDbConnection()

TextConnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & "E:\My Documents\TextFiles" & ";" & _
"Extended Properties=""Text;HDR=NO;"""


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 
Paul, that worked perfect. Thanks//

Paul Clement said:
¤ Using an ODBCConnection and ODBCDataAdapter object, I am able to connect to
¤ a CSV file. However, my data tables are all comeing back with the first line
¤ of the CSV file used as a column header line.
¤
¤ How do i disable this?

You can do it in the connection string or a schema.ini file. Connection string is easier and I would
recommend using the .NET OLEDB library with the Jet provider instead of ODBC:

Dim TextConnection As New OleDbConnection()

TextConnection.ConnectionString =
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
 
Back
Top