title: Fill a Data table from a text file
body: <p>I have this block of code which reads a text file [Tab delimited] and return a data table.  But the problem is that it treat the first line of the file or record as the header and display the remaining lines as records which subtract the number of record by - 1
  so now i want the code to read all the content of the file as records.  </p>
  
  <p>here is the code:</p>
  
  <pre><code>streamReader reader = new streamReader (filePath);
  string line = reader.readLine();
  Datatable dt = new Datatable ();
  DataRow row;
  string[] value = line.Split('\t');
  
  foreach(string dc in value)
  {
   dt.columns.add(New DataColumn(dc));
  }
  
  while(!reader.endofStream)
   {
    value = reader.ReadLine().split('\t');
  
    if (value.Length == dt.Columns.Count)
   {
    row = dt.NewRow();
    row.ItemArray = value;
    dt.Rows.Add(row);
   }
  
   }
  
   return dt;
  </code></pre>
  
  <p>When i try to remove</p>
  
  <pre><code>foreach(string dc in value)
  {
   dt.columns.add(New DataColumn(dc));
  }
  </code></pre>
  
  <p>and all lines code that depend on it , the dt return nothing.</p>
  
  <p>how can i solve it ?</p>