Monday, March 26, 2012

Loop statement for a .TXT

hi

I have to handle rows from a text file so that I can not use ReadToEnd method. So how can I make a loop using StreamReader class

May I set a data reader once I dont have a db connection? how can i do that?

Thanks in advanceread this:http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemiostreamreaderclassreadlinetopic.asp
have already read that

i tried

StreamReader sr = File.OpenText("E:\\test.txt");
string row;
do
{
row = sr.ReadLine();
textBox.Text = row;
}
while (!(row == null));
sr.Close
but nothing yet.. ideas?

0 comments:

Post a Comment