I have a excel file which i converted to a csv and freom this csv, i have to read the data in a vb.net application.
This excel file has 5 columns in each row.
In my code, i used the "," delimiter to retrieve the data.
But, the problem is each column is coming out seperated by a delimiter.
Why is this happening?
Is this something to do with the csv file i generated?
Public Sub getvals()
Dim filetoread As String
filetoread = "C:\Users\MyPC\Desktop\Data with addresses.csv"
Dim filestream As StreamReader
filestream = File.OpenText(filetoread)
Dim readcontents As String
readcontents = filestream.ReadToEnd()
Dim textdelimiter As String
textdelimiter = ","
Dim splitout = Split(readcontents, textdelimiter)
txt_Addr.Text = readcontents & "<br>"
Dim dt As New DataTable
Dim val As New DataColumn
Dim dr As DataRow
Dim i As Integer
For i = 0 To UBound(splitout)
dr = dt.NewRow
dr.Item(0) = splitout(i).ToString
DataGridView1.DataSource = dt