Private Sub frmSelection_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim Datafile() As String = IO.File.ReadAllLines("Datafile.txt")
Dim query = From line In Datafile
Let name = line.Split(","c)(0)
Let surname = line.Split(","c)(1)
Order By name
Select name, surname
lstNames.DataSource = query.ToList
End Sub
sequential text file to list box
Page 1 of 15 Replies - 549 Views - Last Post: 14 March 2012 - 04:52 PM
#1
sequential text file to list box
Posted 14 March 2012 - 04:21 PM
Hey everybody. So confused right now, had a sequential text file loading into a list box this afternoon, opened the programme a few minutes ago and its not working! The text file was loading first name and surname onto the same line, but now it will only put the first name into it. I'm new to VB and to textfiles, so can anyone see any problem with the code below that would be causing this problem? Any help would be greatly appreciated!
Replies To: sequential text file to list box
#2
Re: sequential text file to list box
Posted 14 March 2012 - 04:25 PM
this is probable stupid but i take it the txt file is still in the same place as you left it this morning.
#3
Re: sequential text file to list box
Posted 14 March 2012 - 04:30 PM
It certainly is yes. Do you think there is any problem with the code?
#4
Re: sequential text file to list box
Posted 14 March 2012 - 04:33 PM
I can't see a problem but if have never use Let but just had a look on msdn on how to use let seem to correctly used have you tried using break points to step through your code.
This post has been edited by m_wylie85: 14 March 2012 - 04:37 PM
#5
Re: sequential text file to list box
Posted 14 March 2012 - 04:43 PM
thanks! any other suggestions?
#6
Re: sequential text file to list box
Posted 14 March 2012 - 04:52 PM
Yeah upload your program and text file and i will have a look see if i can spot the problem.
Hey chum just to let you know if you don't upload or let me know what your doing soon i am gonna just go to bed
Hey chum just to let you know if you don't upload or let me know what your doing soon i am gonna just go to bed
This post has been edited by m_wylie85: 14 March 2012 - 05:08 PM
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote




|