Data import using CSV file VB.NET

Viewed 31

This is my first post on this forum so please be understanding. I am a beginner in VB programming. In my current project I need to connect application with a database.

Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click

        Dim tfp As New TextFieldParser("C:\VB\zapis odczyt\sl.csv")
        tfp.TextFieldType = FieldType.Delimited
        tfp.SetDelimiters(";")


        tfp.ReadLine()

        Dim pole As String() = tfp.ReadFields()

        Dim i As Integer = 0

        While tfp.EndOfData = False

            MsgBox(pole(i))
            i = i + 1
        End While
    End Sub

I am asking CSV file for all records but I am reciving only 1 row - after ~20 loops. How can I change a rows and search for some records? I want to understand this mechanism.

0 Answers
Related