My csv file has rows like this:
"col1","col2","col3","col4","col5"
"04/04/2005 01:05:07.576","0","0","0","0"
And I am using this code to read the file:
Dim Conn As OdbcConnection
Dim dt As New DataTable
Dim da As OdbcDataAdapter
Dim strConnstr, strImportfolder, strFilename As String
strImportfolder = "D:\"
strFilename = "filename.csv"
'this is the csv file to be imported
strConnstr = "Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=" &
strImportfolder & "\;"
Conn = New Odbc.OdbcConnection(strConnstr)
da = New Odbc.OdbcDataAdapter("select * from [" + strFilename + "]", Conn)
da.Fill(dt)
MsgBox(dt.Rows(0).Item(0).ToString)
Console.WriteLine(dt.Columns(0).ToString)
Console.WriteLine(dt.Rows.Count)
Dim colnm As DataColumn
For Each colnm In dt.Columns
Console.Write(colnm.ColumnName)
Next
Strange enough I only see 1 colomnname
When I change the comma's to semicolumns I see all the column name's....
How can I get this to work with the comma's instead of first need to change
the file..
Thanx