I have following code that reads data using OleDbDataReader.
The funny thing is that I can only return numbers although I converted to string.
Dim cn As New OleDbConnection
Dim fileloc = Server.MapPath("~/test/")
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + fileloc + ";Extended Properties='text;HDR=Yes;FMT=Delimited'"
cn.Open()
Dim cmd As New OleDbCommand
cmd.Connection = cn
cmd.CommandText = "SELECT * FROM feed.csv"
Dim reader As OleDbDataReader = cmd.ExecuteReader()
While reader.Read()
Response.Write(reader("Stock Number").ToString)
End While
reader.Close()
cn.Close()
So I opened the csv file with test and looked the data.
When ever "Stock Number" has string, it doesn't not return data.
IM-95-189-012 ----> returns blank
2241 -----> returns 2241
2241B -----> returns blank
This is the first time I work with OleDbDataReader.
Any idea what's going on ?