need help with a text file

  • Thread starter Thread starter Dan Sprouse
  • Start date Start date
D

Dan Sprouse

Guest
I need to load this into a listview but not sure how to do it . this dose have
SetDelimiters(vbTab) in it. and the code block is only giving me one line of text not both lines like I need

If System.IO.File.Exists("C:\Sales\" & order2 & ".txt") Then
Using MyReader As New Microsoft.VisualBasic.FileIO.TextFieldParser("C:\Sales\" & order2 & ".txt")
MyReader.TextFieldType = FileIO.FieldType.Delimited
MyReader.SetDelimiters(vbTab)
Dim CurrentRow As String()
While Not MyReader.EndOfData
CurrentRow = MyReader.ReadFields
Dim NewItem As New ListViewItem(CurrentRow(0))
For x As Integer = 1 To CurrentRow.GetUpperBound(0)
NewItem.SubItems.Add(CurrentRow(x))


Next


ListView2.Items.Add(NewItem)
End While
End Using
End If

1407473.png

Continue reading...
 
Back
Top