I want to read the contents of a csv file........first line is headers,.......comma delimited, text has is in "" quotes. I found some help online, but it locks up my system and eventually returns an error:
Ultimately, once the data is in, I want to run some SQL on the contents. this is the header infor:
This is the code I am using. If there is a better way, that is fine:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim folder = "C:\Users\rrudo_000\Documents"
Dim CnStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & folder & ";Extended Properties=""text;HDR=Yes;FMT=Delimited"";"
Dim dt As New DataTable
Using Adp As New OleDbDataAdapter("select * from [ajework.csv]", CnStr)
Dim bs As New BindingSource
Dim datagridview1 As New DataGridView()
bs.DataSource = dt
datagridview1.DataSource = bs