Member Avatar for vinc_1418

Hi, am having problem for comma delimited files, i wanna read data from different lines and also reading a specific line to display it in a text box or a label!!!
anyone can help plz

Recommended Answers

All 2 Replies

You can do something like below :

StreamReader objSR = new StreamReader("Filepath");
string strLine = "";
while((strLine = objSR.ReadLine())!= null)
{
   if(!strLine.Contains("text of heading")) // make sure you are not inserting heading in text box..
   {
      textBox1.Lines = (string[])strline; // It will append line to textbox.
   }
}

this is the basic things you need to modify code as per your requirement.. try this and let us know...

Hi, am having problem for comma delimited files, i wanna read data from different lines and also reading a specific line to display it in a text box or a label!!!
anyone can help plz

CSV? Why are you using this format? You could save a lot of trouble by using a simple database converted from your csv?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.