Reading a text file

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hey all,

i'm trying to read a text file that is comma-delimited. What i'd like to do
is read each line and create a hyperlink entry, based on each line , inside a
datalist.

i'm trying to read the file using ReadToEnd method of a StreamReader hoping
to get it into an array and then bind to a datalist.

thanks,
rodchar
 
Well, you are on the right track by using the ReadToEnd() will return
the entire text in the file. You have to take it a step further and
call the Split function on the string and pass in the comma as the
character to split on. This will return an array of strings which you
can do a foreach over and treat each element in that array the way you
want.
 
Well, see each row contains comma separated data and i need that row to be
intact. so what tried and think worked was i did the
..split(controlchars.crlf).
I don't know it seemed to have worked.
 
Back
Top