Hello, I'm having trouble reading in certain CSV's. When I have an alphanumeric field, It's been read in as a number. Anyone know why and how to fix?
The above code is used to read in the this sample csv
Image may be NSFW.
Clik here to view.
However the result I get in the DGV is as follows;
Image may be NSFW.
Clik here to view.
Thank You
Code:
DialogName = IO.Path.GetFileNameWithoutExtension(DialogFile)
Dim DialogFileName As String = IO.Path.GetFileName(DialogFile)
Dim Page As TabPage = New TabPage() With {.Text = DialogName, .Name = $"{DialogName}"}
Dim dgv As New DataGridView
Dim txtData As DataTable = New DataTable()
'Dim txtCon As OleDb.OleDbConnection = New OleDb.OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;Data Source='" & DialogDirect & "';Extended Properties='Text;HDR=Yes;FMT=Delimited(,)'")
Dim txtCon As OleDb.OleDbConnection = New OleDb.OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;Data Source='" & DialogDirect & "';Extended Properties='Text;HDR=Yes;FMT=Delimited'")
Dim txtCmd As OleDb.OleDbCommand = New OleDb.OleDbCommand("SELECT * FROM [" & DialogFileName & "]", txtCon)
Dim txtAdapt As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter(txtCmd)
txtAdapt.Fill(txtData)
txtCon.Close()
With dgv
.Name = $"dgv{DialogName}"
.Parent = Page
.Dock = DockStyle.Fill
.DataSource = txtData
.AllowUserToAddRows = False
.AllowUserToOrderColumns = False
End With
txtData.Dispose()
Page.Controls.Add(dgv)
BulkTabControl.TabPages.Add(Page)
AddHandler dgv.MouseUp, AddressOf BulkGrid_MouseUp
AddHandler dgv.UserDeletingRow, AddressOf BulkGrid_UserDeletingRow
Image may be NSFW.
Clik here to view.

However the result I get in the DGV is as follows;
Image may be NSFW.
Clik here to view.

Thank You