I would like to do is to read CSV file begin to display to datagridview. show all the rows in the CSV but only the columns between START and END.
This code below is for import all data from csv to datagridview.
If OpenFileDialog1.ShowDialog(Me) = DialogResult.OK Then
Try
Dim fi As New FileInfo(OpenFileDialog1.FileName)
Dim sConnectionStringz As String = "Provider=Microsoft.Jet.OLEDB.4.0;Extended Properties=Text;Data Source=" & fi.DirectoryName
Dim objConn As New OleDbConnection(sConnectionStringz)
objConn.Open()
'DataGridView1.TabIndex = 1
Dim objCmdSelect As New OleDbCommand("SELECT * FROM " & fi.Name, objConn)
Dim objAdapter1 As New OleDbDataAdapter
objAdapter1.SelectCommand = objCmdSelect
Dim objDataset1 As New DataSet
objAdapter1.Fill(objDataset1)
'--objAdapter1.Update(objDataset1) '--updating
DataGridView1.DataSource = objDataset1.Tables(0).DefaultView
objConn.Close()
Finally
End Try
End If