title: Display csv read data in console application in c#
body: <p>I am completely new to programming and trying to get the complete row data from csv file based on column value in c#. Example data is as follows:
  <code>Mat_No;Device;Mat_Des;Dispo_lvl;Plnt;MS;IPDS;TM;Scope;Dev_Cat
  1111;BLB A601;BLB A601;T2;PW01;10;;OP_ELE;LED;
  2222;ALP A0001;ALP A0001;T2;PW01;10;;OP_ELE;LED;</code><br></p>
  
  <p>If user enters a Mat_No he gets the full row data of that particular number. <br>
  I have two files program.cs and filling.cs<br>
  overViewArea.cs contain following code for csv file reading:<br>I dont know how to access the read values from program.cs file and display in console</p>
  
  <pre><code>`using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.IO;
  using System.Data;
  
  namespace TSDB
  {
      class fillData
  
      {
          public static fillData readCsv()
          {
              fillData getData= new fillData ();
  
              using (var reader = new StreamReader(@"myfile.csv"))
              {
                  List&lt;string&gt; headerList = null;
  
  
                  while (!reader.EndOfStream)
  
                  {
                      var line = reader.ReadLine();
                      if(headerList==null)
                      {
                          headerList = line.Split(';').ToList();
                      }
                      else
                      {
                          var values = line.Split(';');
                          for(int i = 0; i&lt; headerList.Count; i++)
                          {
                              Console.Write(headerList[i] + "=" + values[i]+";");
                          }
                          Console.WriteLine();
                      }
  
                  }
              }
  
              return fillData;
          }
  
  
  
      }
  }`
  </code></pre>
  
  <p><br>
  Program.cs has following code<br></p>
  
  <pre><code>class Program
  {
      static void Main(string[] args)
      {
          fillData data= fillData.readCsv();
          Console.ReadLine();
      }
  
  }
  </code></pre>