Private Sub btnImportCustomers_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnImportCustomers.Click
Try
Dim strFilename As String
'Navigate to the text file.
OpenFileDialog1.Filter = "CSV Files|*.csv|All files (*.*)|*.*"
OpenFileDialog1.Title = "Select a CSV File"
OpenFileDialog1.FileName = ""
If OpenFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
strFilename = OpenFileDialog1.FileName
Dim SR As New StreamReader(strFilename)
Do
Dim S As String = SR.ReadLine
If SR.EndOfStream Then
Exit Do
End If
Dim aLine As String() = S.Split(",")
'Import the class into Dynamics.
dowork(aLine)
Loop
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub