Stream Read

bgreer5050

New member
Joined
Jul 4, 2009
Messages
4
Programming Experience
Beginner
I have to save the text boxe values of a form to a text file almost like a data record. I will be saving an Employee First Name, Last Name, Dept Number, and Phone Number. This I know how to do using streamwriter.

I need help with the next form which we have to use stream reader to load one record at a time. The form has a next button to load the next record. How do I seperate each record (I am sorry for calling it a record if this is inappropriate) when use streamreader and how do I load a record at a time.

I know how to open a file and use streamreader, I just don't know how to read one record at a time and move to the next one.
 
You call ReadLine and it will read a line. You don't have to do anything else to move to the next line. The file pointer is initially at the beginning of the first line. You call ReadLine and the first line of text is returned and the file pointer is placed at the beginning of the second line. You just keep calling ReadLine until it returns Nothing or EndOfStream is True, both of which indicate the end of the file.
 
Back
Top