CSV to datatsble via data adapter

Rad

Member
Joined
Feb 26, 2009
Messages
8
Programming Experience
5-10
Getting data from csv. Works fine and has done for ages. Problem is when data is in the form of 'SS01' up to SS09. datatable shows as 1.000 for SS01...
Any other data is read fine.
Any ideas?

Dim Conn As System.Data.Odbc.OdbcConnection
Dim da As System.Data.Odbc.OdbcDataAdapter
Dim strConnstr As String

'this is the csv file to be imported
strConnstr = "Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=" + LocalImportFilePath + ";"
Conn = New Odbc.OdbcConnection(strConnstr)

'import the csv to a dt...
da = New System.Data.Odbc.OdbcDataAdapter("select * from [" + LocalImportFileName + "]", Conn)

da.Fill(dt)
 
Thanks for the reply.

How easy/difficult is it to convert this code to your suggestion?

I'm abit worried about changing this code as I've only recently joined this company.
 
Back
Top