S
stephane8
I'm able to open and read my .csv file. But when the character "-" is
in one of my fields (ex : 18802-002) I get a system.DBNull value ! Even
if I edit the file with notepad and put "18802-002" I still get a
DBNull value... I'm not able to figure this one out, any help would be
appreciated.
Here's my code :
Dim ConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=" & sPath & ";Extended Properties=""Text;HDR=NO;FMT=Delimited"""
Dim Conn As New System.Data.OleDb.OleDbConnection(ConnectionString)
Conn.Open()
Dim da As New System.Data.OleDb.OleDbDataAdapter("SELECT * FROM
" & sFile, Conn)
Dim ds As New DataSet("TextFiles")
da.Fill(ds, "XYZ")
Dim dt As DataTable = ds.Tables("XYZ")
For Each sRow As DataRow In dt.Rows
....
Next
in one of my fields (ex : 18802-002) I get a system.DBNull value ! Even
if I edit the file with notepad and put "18802-002" I still get a
DBNull value... I'm not able to figure this one out, any help would be
appreciated.
Here's my code :
Dim ConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=" & sPath & ";Extended Properties=""Text;HDR=NO;FMT=Delimited"""
Dim Conn As New System.Data.OleDb.OleDbConnection(ConnectionString)
Conn.Open()
Dim da As New System.Data.OleDb.OleDbDataAdapter("SELECT * FROM
" & sFile, Conn)
Dim ds As New DataSet("TextFiles")
da.Fill(ds, "XYZ")
Dim dt As DataTable = ds.Tables("XYZ")
For Each sRow As DataRow In dt.Rows
....
Next